Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
zjg555543 committed Oct 27, 2023
1 parent 477484a commit 8cfc5c3
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 15 deletions.
4 changes: 2 additions & 2 deletions config/config.local.toml
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,9 @@ RootCAPath = "/app/root-ca-cert"

[NetworkConfig]
GenBlockNumber = 1
PolygonBridgeAddress = "0xFc2f92CBFA1b38a4B38B412F582cf08028cBA9e0"
PolygonBridgeAddress = "0x10B65c586f795aF3eCCEe594fE4E38E1F059F780"
PolygonZkEVMGlobalExitRootAddress = "0xEd236da21Ff62bC7B62608AdB818da49E8549fa7"
L2PolygonBridgeAddresses = ["0xFc2f92CBFA1b38a4B38B412F582cf08028cBA9e0"]
L2PolygonBridgeAddresses = ["0x10B65c586f795aF3eCCEe594fE4E38E1F059F780"]

[Nacos]
NacosUrls = ""
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ services:
- "/bin/sh"
- "-c"
- "/app/xgon-node approve --network custom --custom-network-file /app/genesis.json --am 115792089237316195423570985008687907853269984665640564039457584007913129639935 -y --cfg /app/config.toml --key-store-path /pk/keystore.sequencer --password testonly &&
/app/xgon-node run --network custom --custom-network-file /app/genesis.json --cfg /app/config.toml --components \"synchronizer,rpc,sequencer,aggregator,eth-tx-manager,l2gaspricer\""
/app/xgon-node run --network custom --custom-network-file /app/genesis.json --cfg /app/config.toml --components \"synchronizer,rpc,sequencer,sequence-sender,aggregator,eth-tx-manager,l2gaspricer\""

xgon-mock-l1-network:
container_name: xgon-local-l1-network
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -184,4 +184,4 @@ require (
rsc.io/tmplfunc v0.0.3 // indirect
)

replace github.com/0xPolygonHermez/zkevm-node => github.com/okx/Xgon-node v0.2.6-RC3.0.20231024150851-dda43254baf5
replace github.com/0xPolygonHermez/zkevm-node => github.com/okx/Xgon-node v0.2.6-RC3.0.20231025144010-cd949ccdee23
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -708,8 +708,8 @@ github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE=
github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU=
github.com/oklog/oklog v0.3.2/go.mod h1:FCV+B7mhrz4o+ueLpx+KqkyXRGMWOYEvfiXtdGtbWGs=
github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA=
github.com/okx/Xgon-node v0.2.6-RC3.0.20231024150851-dda43254baf5 h1:p/yzleDvjH8ZmfwMDS0OBkAIjy4gYUD2IcwWMYlZd5w=
github.com/okx/Xgon-node v0.2.6-RC3.0.20231024150851-dda43254baf5/go.mod h1:n3w21Wec5I+ISPbcMhThQd/CPuzwpSjt7HEz1VwnoFo=
github.com/okx/Xgon-node v0.2.6-RC3.0.20231025144010-cd949ccdee23 h1:Rx+ST0Tlsfb3SIQQFmM5iFRqLAuFfpgZf3MAAmwQf5U=
github.com/okx/Xgon-node v0.2.6-RC3.0.20231025144010-cd949ccdee23/go.mod h1:n3w21Wec5I+ISPbcMhThQd/CPuzwpSjt7HEz1VwnoFo=
github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo=
github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec=
github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY=
Expand Down
8 changes: 4 additions & 4 deletions test/e2e/bridge_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ func TestE2E(t *testing.T) {
require.NoError(t, err)
err = opsman.MintERC20(ctx, tokenAddr, totAmount, operations.L1)
require.NoError(t, err)
origAddr := common.HexToAddress("0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC")
origAddr := common.HexToAddress("0x2ecf31ece36ccac2d3222a303b1409233ecbb225")
balance, err := opsman.CheckAccountTokenBalance(ctx, operations.L1, tokenAddr, &origAddr)
require.NoError(t, err)
t.Log("Init account balance l1: ", balance)
Expand Down Expand Up @@ -261,7 +261,7 @@ func TestE2E(t *testing.T) {
balance, err := opsman.CheckAccountTokenBalance(ctx, operations.L2, tokenAddr, &origAddr)
require.NoError(t, err)
t.Log("Token balance: ", balance, ". tokenaddress: ", tokenAddr, ". account: ", origAddr)
destAddr := common.HexToAddress("0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC")
destAddr := common.HexToAddress("0x2ecf31ece36ccac2d3222a303b1409233ecbb225")
amount = new(big.Int).SetUint64(1000000000000000000)
err = opsman.SendL2Deposit(ctx, tokenAddr, amount, destNetwork, &destAddr)
require.NoError(t, err)
Expand Down Expand Up @@ -349,7 +349,7 @@ func TestE2E(t *testing.T) {
require.NoError(t, err)
err = opsman.MintERC20(ctx, tokenAddr, amount, operations.L1)
require.NoError(t, err)
origAddr := common.HexToAddress("0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC")
origAddr := common.HexToAddress("0x2ecf31ece36ccac2d3222a303b1409233ecbb225")
balance, err := opsman.CheckAccountTokenBalance(ctx, operations.L1, tokenAddr, &origAddr)
require.NoError(t, err)
t.Log("Init account balance l1: ", balance)
Expand Down Expand Up @@ -441,7 +441,7 @@ func TestE2E(t *testing.T) {
require.NoError(t, err)
err = opsman.MintERC20(ctx, tokenAddr, totAmount, operations.L1)
require.NoError(t, err)
origAddr := common.HexToAddress("0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC")
origAddr := common.HexToAddress("0x2ecf31ece36ccac2d3222a303b1409233ecbb225")
balance, err := opsman.CheckAccountTokenBalance(ctx, operations.L1, tokenAddr, &origAddr)
require.NoError(t, err)
t.Log("Init account balance l1: ", balance)
Expand Down
6 changes: 3 additions & 3 deletions test/e2e/edge_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (

func depositFromL1(ctx context.Context, opsman *operations.Manager, t *testing.T) {
amount := new(big.Int).SetUint64(250000000000000000)
tokenAddr := common.Address{} // This means is eth
tokenAddr := common.HexToAddress("0xcFE6D77a653b988203BfAc9C6a69eA9D583bdC2b") // This means is okb
destAddr := common.HexToAddress("0xc949254d682d8c9ad5682521675b8f43b102aec4")
var destNetwork uint32 = 1
// L1 Deposit
Expand All @@ -37,8 +37,8 @@ func depositFromL2(ctx context.Context, opsman *operations.Manager, t *testing.T
// Send L2 Deposit to withdraw the some funds
var destNetwork uint32 = 0
amount := new(big.Int).SetUint64(100000000000000000)
tokenAddr := common.Address{} // This means is eth
destAddr := common.HexToAddress("0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC")
tokenAddr := common.Address{} // This means is okb
destAddr := common.HexToAddress("0x2ecf31ece36ccac2d3222a303b1409233ecbb225")
err := opsman.SendL2Deposit(ctx, tokenAddr, amount, destNetwork, &destAddr)
require.NoError(t, err)

Expand Down
4 changes: 2 additions & 2 deletions test/operations/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ const (
l1BridgeAddr = "0xFc2f92CBFA1b38a4B38B412F582cf08028cBA9e0"
l2BridgeAddr = "0xFc2f92CBFA1b38a4B38B412F582cf08028cBA9e0"

l1AccHexAddress = "0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC"
l1AccHexAddress = "0x2ecf31ece36ccac2d3222a303b1409233ecbb225"

sequencerAddress = "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266"

Expand All @@ -61,7 +61,7 @@ const (
var (
dbConfig = pgstorage.NewConfigFromEnv()
accHexPrivateKeys = map[NetworkSID]string{
L1: "0x5de4111afa1a4b94908f83103eb1f1706367c2e68ca870fc3fb9a804cdab365a", //0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC
L1: "0xde3ca643a52f5543e84ba984c4419ff40dbabd0e483c31c1d09fee8168d68e38", //0x2ecf31ece36ccac2d3222a303b1409233ecbb225
L2: "0xdfd01798f92667dbf91df722434e8fbe96af0211d4d1b82bbbbc8f1def7a814f", //0xc949254d682d8c9ad5682521675b8f43b102aec4
}
)
Expand Down
1 change: 1 addition & 0 deletions utils/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ func (c *Client) SendBridgeAsset(ctx context.Context, tokenAddr common.Address,
if destAddr == nil {
destAddr = &auth.From
}
log.Infof("token address:%v, amount:%v, destnetwork:%v, dest address:%v", tokenAddr.String(), amount.String(), destNetwork, destAddr.String())
tx, err := c.bridge.BridgeAsset(auth, destNetwork, *destAddr, amount, tokenAddr, true, metadata)
if err != nil {
log.Error("Error: ", err)
Expand Down

0 comments on commit 8cfc5c3

Please sign in to comment.