Skip to content

Commit

Permalink
trim prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
gartnera committed Jun 27, 2024
1 parent ead440e commit e769d2b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion e2e/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"errors"
"fmt"
"os"
"strings"

"github.com/btcsuite/btcd/chaincfg"
"github.com/cosmos/cosmos-sdk/types/bech32"
Expand Down Expand Up @@ -334,7 +335,8 @@ func generateAccount() (Account, error) {
return Account{}, fmt.Errorf("generating private key: %w", err)

Check warning on line 335 in e2e/config/config.go

View check run for this annotation

Codecov / codecov/patch

e2e/config/config.go#L335

Added line #L335 was not covered by tests
}
// 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())
Expand Down

0 comments on commit e769d2b

Please sign in to comment.