Skip to content
This repository was archived by the owner on Jun 6, 2024. It is now read-only.

Commit cfa67fc

Browse files
author
yq
authored
Merge pull request #49 from 15000785133/qa
Merge qa branch into testnet
2 parents 86d2345 + 6b81b63 commit cfa67fc

File tree

6 files changed

+85
-87
lines changed

6 files changed

+85
-87
lines changed

client/l2_client.go

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import (
66
"errors"
77
"fmt"
88
"github.com/bnb-chain/zkbnb-crypto/wasm/txtypes"
9+
"github.com/consensys/gnark-crypto/ecc/bn254/fr"
910
"io"
1011
"math/big"
1112
"net"
@@ -1218,7 +1219,11 @@ func (c *l2Client) fullFillDefaultOps(ops *types.TransactOpts) (*types.TransactO
12181219
}
12191220
if len(ops.CallDataHash) == 0 {
12201221
hFunc := mimc.NewMiMC()
1221-
ops.CallDataHash = hFunc.Sum([]byte(ops.CallData))
1222+
var x fr.Element
1223+
_ = x.SetBytes([]byte(ops.CallData))
1224+
b := x.Bytes()
1225+
hFunc.Write(b[:])
1226+
ops.CallDataHash = hFunc.Sum(nil)
12221227
}
12231228
if ops.GasFeeAssetAmount == nil {
12241229
gas, err := c.GetGasFee(ops.GasFeeAssetId, ops.TxType)
@@ -1325,11 +1330,7 @@ func (c *l2Client) constructMintNftTransaction(tx *types.MintNftTxReq, ops *type
13251330
if err != nil {
13261331
return nil, err
13271332
}
1328-
1329-
ops, err = c.fullFillToAddrOps(ops, tx.To)
1330-
if err != nil {
1331-
return nil, err
1332-
}
1333+
ops.ToAccountAddress = tx.To
13331334

13341335
txInfo, err := txutils.ConstructMintNftTx(c.keyManager, tx, ops)
13351336
if err != nil {

go.mod

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,20 @@ go 1.18
55
require (
66
github.com/bnb-chain/zkbnb-crypto v0.0.8-0.20230217071307-211b4b7e8923
77
github.com/bnb-chain/zkbnb-eth-rpc v0.0.2
8-
github.com/consensys/gnark-crypto v0.7.0
8+
github.com/consensys/gnark-crypto v0.9.1
99
github.com/ethereum/go-ethereum v1.10.26
10-
github.com/stretchr/testify v1.8.0
10+
github.com/stretchr/testify v1.8.1
1111
)
1212

1313
require (
14-
github.com/consensys/gnark v0.7.0 // indirect
15-
github.com/fxamacker/cbor/v2 v2.4.0 // indirect
14+
github.com/blang/semver/v4 v4.0.0 // indirect
15+
github.com/consensys/bavard v0.1.13 // indirect
16+
github.com/consensys/gnark v0.8.0 // indirect
17+
github.com/mattn/go-colorable v0.1.12 // indirect
18+
github.com/mattn/go-isatty v0.0.14 // indirect
1619
github.com/mmcloughlin/addchain v0.4.0 // indirect
17-
github.com/rs/zerolog v1.26.1 // indirect
18-
github.com/x448/float16 v0.8.4 // indirect
20+
github.com/rs/zerolog v1.29.0 // indirect
21+
rsc.io/tmplfunc v0.0.3 // indirect
1922
)
2023

2124
require (
@@ -34,16 +37,16 @@ require (
3437
github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible // indirect
3538
github.com/tklauser/go-sysconf v0.3.5 // indirect; indirectg
3639
github.com/tklauser/numcpus v0.2.2 // indirect
37-
golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa // indirect
38-
golang.org/x/sys v0.2.0 // indirect
40+
golang.org/x/crypto v0.6.0 // indirect
41+
golang.org/x/sys v0.5.0 // indirect
3942
gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce // indirect
4043
gopkg.in/yaml.v3 v3.0.1 // indirect
4144
)
4245

43-
replace github.com/consensys/gnark => github.com/bnb-chain/gnark v0.7.1-0.20230206150652-4e87ef37b4e7
46+
replace github.com/consensys/gnark => github.com/bnb-chain/gnark v0.7.1-0.20230412065523-4d344ff30ab3
4447

45-
replace github.com/consensys/gnark-crypto => github.com/bnb-chain/gnark-crypto v0.7.1-0.20230203031630-7c643ad11891
48+
replace github.com/consensys/gnark-crypto => github.com/bnb-chain/gnark-crypto v0.8.1-0.20230412061827-228166c33652
4649

47-
replace github.com/bnb-chain/zkbnb-crypto => github.com/15000785133/zkbnb-crypto v0.0.8-0.20230403144529-4e2e8ffac4bd
50+
replace github.com/bnb-chain/zkbnb-crypto => github.com/15000785133/zkbnb-crypto v0.0.8-0.20230419115132-7064c667baff
4851

4952
replace github.com/bnb-chain/zkbnb-eth-rpc => github.com/15000785133/zkbnb-eth-rpc v0.0.3-0.20230323082501-ae497b894451

0 commit comments

Comments
 (0)