Skip to content

Commit

Permalink
client-sdk: Fix ETH address handling
Browse files Browse the repository at this point in the history
Fix ETH address handling for non-secp256k1 test accounts.
  • Loading branch information
matevz committed Apr 27, 2023
1 parent 54f5588 commit ab10199
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion client-sdk/go/helpers/address.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,11 @@ func ResolveAddress(net *config.Network, address string) (*types.Address, *ethCo
case addressExplicitTest:
// Test key.
if testKey, ok := testing.TestAccounts[data]; ok {
return &testKey.Address, &testKey.EthAddress, nil
var ethAddress *ethCommon.Address
if testKey.SigSpec.Secp256k1Eth != nil {
ethAddress = &testKey.EthAddress
}
return &testKey.Address, ethAddress, nil
}
return nil, nil, fmt.Errorf("unsupported test account: %s", data)
default:
Expand Down

0 comments on commit ab10199

Please sign in to comment.