From e769d2b09065af0757f049dad394afc485c4df48 Mon Sep 17 00:00:00 2001 From: Alex Gartner Date: Thu, 27 Jun 2024 09:13:55 -0700 Subject: [PATCH] trim prefix --- e2e/config/config.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/e2e/config/config.go b/e2e/config/config.go index 3b33fee697..66409ee339 100644 --- a/e2e/config/config.go +++ b/e2e/config/config.go @@ -5,6 +5,7 @@ import ( "errors" "fmt" "os" + "strings" "github.com/btcsuite/btcd/chaincfg" "github.com/cosmos/cosmos-sdk/types/bech32" @@ -334,7 +335,8 @@ func generateAccount() (Account, error) { return Account{}, fmt.Errorf("generating private key: %w", err) } // encode private key and strip 0x prefix - encodedPrivateKey := hexutil.Encode(crypto.FromECDSA(privateKey))[2:] + encodedPrivateKey := hexutil.Encode(crypto.FromECDSA(privateKey)) + encodedPrivateKey = strings.TrimPrefix(encodedPrivateKey, "0x") evmAddress := crypto.PubkeyToAddress(privateKey.PublicKey) bech32Address, err := bech32.ConvertAndEncode("zeta", evmAddress.Bytes())