Skip to content

Commit

Permalink
Merge pull request #1450 from 0chain/hotfix/estimate-mint-wzcn
Browse files Browse the repository at this point in the history
Hotfix: fixed mint WZCN signature decoding
  • Loading branch information
dabasov authored Apr 2, 2024
2 parents 404424b + 8f34ec7 commit ff96e64
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion zcnbridge/bridge.go
Original file line number Diff line number Diff line change
Expand Up @@ -1089,9 +1089,23 @@ func (b *BridgeClient) EstimateMintWZCNGasAmount(
nonce := new(big.Int)
nonce.SetInt64(nonceRaw)

var (
signatureRaw string

signatureHex []byte
err error
)

var signatures [][]byte
for _, signature := range signaturesRaw {
signatures = append(signatures, []byte(signature))
signatureRaw, _ = strings.CutPrefix(signature, "0x")

signatureHex, err = hex.DecodeString(signatureRaw)
if err != nil {
return 0, err
}

signatures = append(signatures, signatureHex)
}

fromRaw := common.HexToAddress(from)
Expand Down

0 comments on commit ff96e64

Please sign in to comment.