From 529f6b85c8ecfc4492f5cc662ba318e2e26cc427 Mon Sep 17 00:00:00 2001 From: sahith-narahari Date: Tue, 10 Nov 2020 19:24:16 +0530 Subject: [PATCH] update combine --- server/rosetta/services/construction.go | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/server/rosetta/services/construction.go b/server/rosetta/services/construction.go index 810b935c521c..6fa54ee39ef4 100644 --- a/server/rosetta/services/construction.go +++ b/server/rosetta/services/construction.go @@ -52,7 +52,7 @@ func (sn SingleNetwork) ConstructionCombine(ctx context.Context, request *types. copy(compressedPublicKey, cmp.SerializeCompressed()) pubKey := &secp256k1.PubKey{Key: compressedPublicKey} - accountInfo, err := sn.client.AccountInfo(ctx, sdk.AccAddress(compressedPublicKey).String(), nil) + accountInfo, err := sn.client.AccountInfo(ctx, sdk.AccAddress(pubKey.Address()).String(), nil) if err != nil { return nil, rosetta.ToRosettaError(err) } @@ -177,13 +177,16 @@ func (sn SingleNetwork) ConstructionParse(ctx context.Context, request *types.Co } txBldr, _ := TxConfig.WrapTxBuilder(rawTx) - addrs := txBldr.GetTx().GetSigners() + var accountIdentifierSigners []*types.AccountIdentifier - for _, addr := range addrs { - signer := &types.AccountIdentifier{ - Address: addr.String(), + if request.Signed { + addrs := txBldr.GetTx().GetSigners() + for _, addr := range addrs { + signer := &types.AccountIdentifier{ + Address: addr.String(), + } + accountIdentifierSigners = append(accountIdentifierSigners, signer) } - accountIdentifierSigners = append(accountIdentifierSigners, signer) } return &types.ConstructionParseResponse{