From 8159df2cfde67761c2e114ebec6519319bf54e04 Mon Sep 17 00:00:00 2001 From: otherview Date: Thu, 25 Jul 2024 14:25:24 +0100 Subject: [PATCH] addin consts --- consts/consts.go | 10 ++++ environments/docker/docker_test.go | 68 ++++++++++++++------------ environments/local/local.go | 18 +++---- environments/local/local_node.go | 6 +-- environments/local/local_test.go | 16 +++++- preset/LocalSixNodes.go | 78 +++++++++++++++--------------- preset/LocalThreeMasterNodes.go | 24 ++++----- 7 files changed, 124 insertions(+), 96 deletions(-) create mode 100644 consts/consts.go diff --git a/consts/consts.go b/consts/consts.go new file mode 100644 index 0000000..8bb56db --- /dev/null +++ b/consts/consts.go @@ -0,0 +1,10 @@ +package consts + +import ( + "github.com/ethereum/go-ethereum/common/hexutil" + "math/big" +) + +var ( + LargeBigValue = new(big.Int).SetBytes(hexutil.MustDecode("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff")) +) diff --git a/environments/docker/docker_test.go b/environments/docker/docker_test.go index 850e3c2..da9dbdf 100644 --- a/environments/docker/docker_test.go +++ b/environments/docker/docker_test.go @@ -17,39 +17,45 @@ func TestDockerNetwork(t *testing.T) { networkCfg := &network.Network{ Environment: "docker", ID: "test-id", - Nodes: []*node.Node{ - { - ID: "node1", - ExecArtifact: "vechain/thor:latest", - Genesis: preset.LocalThreeMasterNodesNetworkGenesis, - DataDir: "/home/thor", - ConfigDir: "/home/thor", - APIAddr: "0.0.0.0:8545", - APICORS: "*", - P2PListenPort: 30303, - Key: preset.LocalThreeMasterNodesNetwork.Nodes[0].Key, + Nodes: []node.Node{ + &node.NodePreCoefFork{ + BaseNode: node.BaseNode{ + ID: "node1", + ExecArtifact: "vechain/thor:latest", + DataDir: "/home/thor", + ConfigDir: "/home/thor", + APIAddr: "0.0.0.0:8545", + APICORS: "*", + P2PListenPort: 30303, + Key: preset.LocalThreeMasterNodesNetwork.Nodes[0].GetKey(), + }, + Genesis: preset.LocalThreeMasterNodesNetworkGenesis, }, - { - ID: "node2", - ExecArtifact: "vechain/thor:latest", - Genesis: preset.LocalThreeMasterNodesNetworkGenesis, - DataDir: "/home/thor", - ConfigDir: "/home/thor", - APIAddr: "0.0.0.0:8545", - APICORS: "*", - P2PListenPort: 30303, - Key: preset.LocalThreeMasterNodesNetwork.Nodes[1].Key, + &node.NodePreCoefFork{ + BaseNode: node.BaseNode{ + ID: "node2", + ExecArtifact: "vechain/thor:latest", + DataDir: "/home/thor", + ConfigDir: "/home/thor", + APIAddr: "0.0.0.0:8545", + APICORS: "*", + P2PListenPort: 30303, + Key: preset.LocalThreeMasterNodesNetwork.Nodes[1].GetKey(), + }, + Genesis: preset.LocalThreeMasterNodesNetworkGenesis, }, - { - ID: "node3", - ExecArtifact: "vechain/thor:latest", - Genesis: preset.LocalThreeMasterNodesNetworkGenesis, - DataDir: "/home/thor", - ConfigDir: "/home/thor", - APIAddr: "0.0.0.0:8545", - APICORS: "*", - P2PListenPort: 30303, - Key: preset.LocalThreeMasterNodesNetwork.Nodes[2].Key, + &node.NodePreCoefFork{ + BaseNode: node.BaseNode{ + ID: "node3", + ExecArtifact: "vechain/thor:latest", + DataDir: "/home/thor", + ConfigDir: "/home/thor", + APIAddr: "0.0.0.0:8545", + APICORS: "*", + P2PListenPort: 30303, + Key: preset.LocalThreeMasterNodesNetwork.Nodes[2].GetKey(), + }, + Genesis: preset.LocalThreeMasterNodesNetworkGenesis, }, }, } diff --git a/environments/local/local.go b/environments/local/local.go index 6ee725d..97d0976 100644 --- a/environments/local/local.go +++ b/environments/local/local.go @@ -15,14 +15,6 @@ type Local struct { id string } -func fileExists(path string) bool { - _, err := os.Stat(path) - if os.IsNotExist(err) { - return false - } - return err == nil -} - func NewLocalEnv() environments.Actions { return &Local{ localNodes: map[string]*Node{}, @@ -46,7 +38,7 @@ func (l *Local) LoadConfig(cfg *network.Network) (string, error) { // check if the exec artifact path exists if !fileExists(n.GetExecArtifact()) { - return "", fmt.Errorf("file does not exist at path: %s", n.GetExecArtifact()) + return "", fmt.Errorf("exec does not exist at path: %s", n.GetExecArtifact()) } } @@ -90,3 +82,11 @@ func (l *Local) Info() error { //TODO implement me panic("implement me") } + +func fileExists(path string) bool { + _, err := os.Stat(path) + if os.IsNotExist(err) { + return false + } + return err == nil +} diff --git a/environments/local/local_node.go b/environments/local/local_node.go index a0fe1b1..2f0e6ff 100644 --- a/environments/local/local_node.go +++ b/environments/local/local_node.go @@ -94,9 +94,9 @@ func (n *Node) Start() error { } fmt.Println(cmd) - if n.nodeCfg.GetID() == "node1" { - return nil - } + //if n.nodeCfg.GetID() == "node1" { + // return nil + //} // Start the command and check for errors if err := cmd.Start(); err != nil { return fmt.Errorf("failed to start thor command: %w", err) diff --git a/environments/local/local_test.go b/environments/local/local_test.go index f9ce5ef..a5e666b 100644 --- a/environments/local/local_test.go +++ b/environments/local/local_test.go @@ -165,7 +165,7 @@ func TestLocal(t *testing.T) { } func TestSixNodeLocal(t *testing.T) { - t.Skip() + //t.Skip() sixNodeJson, err := json.Marshal(preset.LocalSixNodesNetwork) require.NoError(t, err) @@ -174,6 +174,11 @@ func TestSixNodeLocal(t *testing.T) { ) require.NoError(t, err) + // ensure the artifact path is set + for _, node := range networkCfg.Nodes { + node.SetExecArtifact("/Users/pedro/go/src/github.com/vechain/thor/bin/thor") + } + localEnv := NewLocalEnv() _, err = localEnv.LoadConfig(networkCfg) require.NoError(t, err) @@ -181,7 +186,14 @@ func TestSixNodeLocal(t *testing.T) { err = localEnv.StartNetwork() require.NoError(t, err) - time.Sleep(5 * time.Minute) + time.Sleep(30 * time.Second) // todo change this to a polling approach + for _, node := range networkCfg.Nodes { + c := client.NewClient("http://" + node.GetAPIAddr()) + peers, err := c.GetPeers() + require.NoError(t, err) + + require.GreaterOrEqual(t, len(peers), 0) + } err = localEnv.StopNetwork() require.NoError(t, err) } diff --git a/preset/LocalSixNodes.go b/preset/LocalSixNodes.go index 4a5a947..7e4a33f 100644 --- a/preset/LocalSixNodes.go +++ b/preset/LocalSixNodes.go @@ -1,9 +1,9 @@ package preset import ( + "github.com/vechain/networkhub/consts" "math/big" - "github.com/ethereum/go-ethereum/common/hexutil" "github.com/vechain/networkhub/environments" "github.com/vechain/networkhub/network" "github.com/vechain/networkhub/network/node" @@ -19,7 +19,7 @@ var LocalSixNodesNetwork = &network.Network{ BaseNode: node.BaseNode{ ID: "node1", P2PListenPort: 8081, - APIAddr: "0.0.0.0:8181", + APIAddr: "127.0.0.1:8181", APICORS: "*", Type: node.MasterNode, Verbosity: 4, @@ -31,7 +31,7 @@ var LocalSixNodesNetwork = &network.Network{ BaseNode: node.BaseNode{ ID: "node2", P2PListenPort: 8082, - APIAddr: "0.0.0.0:8182", + APIAddr: "127.0.0.1:8182", APICORS: "*", Type: node.MasterNode, Verbosity: 4, @@ -43,7 +43,7 @@ var LocalSixNodesNetwork = &network.Network{ BaseNode: node.BaseNode{ ID: "node3", P2PListenPort: 8083, - APIAddr: "0.0.0.0:8183", + APIAddr: "127.0.0.1:8183", APICORS: "*", Type: node.RegularNode, Key: "1b310ea04afd6d14a8f142158873fc70bfd4ba12a19138cc5b309fce7c77105e", // 0x1b1c0055065b3ADee4B9a9e8297142Ba2cD34EfE @@ -54,7 +54,7 @@ var LocalSixNodesNetwork = &network.Network{ BaseNode: node.BaseNode{ ID: "node4", P2PListenPort: 8084, - APIAddr: "0.0.0.0:8184", + APIAddr: "127.0.0.1:8184", APICORS: "*", Type: node.MasterNode, Verbosity: 4, @@ -66,7 +66,7 @@ var LocalSixNodesNetwork = &network.Network{ BaseNode: node.BaseNode{ ID: "node5", P2PListenPort: 8085, - APIAddr: "0.0.0.0:8185", + APIAddr: "127.0.0.1:8185", APICORS: "*", Type: node.MasterNode, Verbosity: 4, @@ -78,7 +78,7 @@ var LocalSixNodesNetwork = &network.Network{ BaseNode: node.BaseNode{ ID: "node6", P2PListenPort: 8086, - APIAddr: "0.0.0.0:8186", + APIAddr: "127.0.0.1:8186", APICORS: "*", Type: node.RegularNode, Key: "92ad65923d6782a43e6a1be01a8e52bce701967d78937e73da746a58f293ba30", // 0x9C2871C411CCe579B987E9b932C484dA8b901075 @@ -95,7 +95,7 @@ var localSixNodesNetworkGenesis = &genesis.CustomGenesis{ Accounts: []genesis.Account{ { Address: thor.MustParseAddress("0x7567d83b7b8d80addcb281a71d54fc7b3364ffed"), - Balance: convToHexOrDecimal256(new(big.Int).SetBytes(hexutil.MustDecode("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"))), + Balance: convToHexOrDecimal256(consts.LargeBigValue), Energy: convToHexOrDecimal256(big.NewInt(0)), Code: "0x6060604052600256", Storage: map[string]thor.Bytes32{ @@ -104,78 +104,78 @@ var localSixNodesNetworkGenesis = &genesis.CustomGenesis{ }, { Address: thor.MustParseAddress("0x5F90f56c7b87E3d1acf9437f0E43E4d687AcEB7e"), - Balance: convToHexOrDecimal256(new(big.Int).SetBytes(hexutil.MustDecode("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"))), - Energy: convToHexOrDecimal256(new(big.Int).SetBytes(hexutil.MustDecode("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"))), + Balance: convToHexOrDecimal256(consts.LargeBigValue), + Energy: convToHexOrDecimal256(consts.LargeBigValue), }, { Address: thor.MustParseAddress("0x5c29518F6a6124a2BeE89253347c8295f604710A"), - Balance: convToHexOrDecimal256(new(big.Int).SetBytes(hexutil.MustDecode("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"))), - Energy: convToHexOrDecimal256(new(big.Int).SetBytes(hexutil.MustDecode("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"))), + Balance: convToHexOrDecimal256(consts.LargeBigValue), + Energy: convToHexOrDecimal256(consts.LargeBigValue), }, { Address: thor.MustParseAddress("0x1b1c0055065b3ADee4B9a9e8297142Ba2cD34EfE"), - Balance: convToHexOrDecimal256(new(big.Int).SetBytes(hexutil.MustDecode("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"))), - Energy: convToHexOrDecimal256(new(big.Int).SetBytes(hexutil.MustDecode("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"))), + Balance: convToHexOrDecimal256(consts.LargeBigValue), + Energy: convToHexOrDecimal256(consts.LargeBigValue), }, { Address: thor.MustParseAddress("0x042306e116Dc301ecd7b83a04F4c8277Fbe41b6c"), - Balance: convToHexOrDecimal256(new(big.Int).SetBytes(hexutil.MustDecode("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"))), - Energy: convToHexOrDecimal256(new(big.Int).SetBytes(hexutil.MustDecode("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"))), + Balance: convToHexOrDecimal256(consts.LargeBigValue), + Energy: convToHexOrDecimal256(consts.LargeBigValue), }, { Address: thor.MustParseAddress("0x0aeC31606e217895696771961de416Efa185Be66"), - Balance: convToHexOrDecimal256(new(big.Int).SetBytes(hexutil.MustDecode("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"))), - Energy: convToHexOrDecimal256(new(big.Int).SetBytes(hexutil.MustDecode("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"))), + Balance: convToHexOrDecimal256(consts.LargeBigValue), + Energy: convToHexOrDecimal256(consts.LargeBigValue), }, { Address: thor.MustParseAddress("0xf077b491b355E64048cE21E3A6Fc4751eEeA77fa"), - Balance: convToHexOrDecimal256(new(big.Int).SetBytes(hexutil.MustDecode("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"))), - Energy: convToHexOrDecimal256(new(big.Int).SetBytes(hexutil.MustDecode("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"))), + Balance: convToHexOrDecimal256(consts.LargeBigValue), + Energy: convToHexOrDecimal256(consts.LargeBigValue), }, { Address: thor.MustParseAddress("0x435933c8064b4Ae76bE665428e0307eF2cCFBD68"), - Balance: convToHexOrDecimal256(new(big.Int).SetBytes(hexutil.MustDecode("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"))), - Energy: convToHexOrDecimal256(new(big.Int).SetBytes(hexutil.MustDecode("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"))), + Balance: convToHexOrDecimal256(consts.LargeBigValue), + Energy: convToHexOrDecimal256(consts.LargeBigValue), }, { Address: thor.MustParseAddress("0x0F872421Dc479F3c11eDd89512731814D0598dB5"), - Balance: convToHexOrDecimal256(new(big.Int).SetBytes(hexutil.MustDecode("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"))), - Energy: convToHexOrDecimal256(new(big.Int).SetBytes(hexutil.MustDecode("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"))), + Balance: convToHexOrDecimal256(consts.LargeBigValue), + Energy: convToHexOrDecimal256(consts.LargeBigValue), }, { Address: thor.MustParseAddress("0xF370940aBDBd2583bC80bfc19d19bc216C88Ccf0"), - Balance: convToHexOrDecimal256(new(big.Int).SetBytes(hexutil.MustDecode("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"))), - Energy: convToHexOrDecimal256(new(big.Int).SetBytes(hexutil.MustDecode("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"))), + Balance: convToHexOrDecimal256(consts.LargeBigValue), + Energy: convToHexOrDecimal256(consts.LargeBigValue), }, { Address: thor.MustParseAddress("0x99602e4Bbc0503b8ff4432bB1857F916c3653B85"), - Balance: convToHexOrDecimal256(new(big.Int).SetBytes(hexutil.MustDecode("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"))), - Energy: convToHexOrDecimal256(new(big.Int).SetBytes(hexutil.MustDecode("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"))), + Balance: convToHexOrDecimal256(consts.LargeBigValue), + Energy: convToHexOrDecimal256(consts.LargeBigValue), }, { Address: thor.MustParseAddress("0x61E7d0c2B25706bE3485980F39A3a994A8207aCf"), - Balance: convToHexOrDecimal256(new(big.Int).SetBytes(hexutil.MustDecode("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"))), - Energy: convToHexOrDecimal256(new(big.Int).SetBytes(hexutil.MustDecode("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"))), + Balance: convToHexOrDecimal256(consts.LargeBigValue), + Energy: convToHexOrDecimal256(consts.LargeBigValue), }, { Address: thor.MustParseAddress("0x361277D1b27504F36a3b33d3a52d1f8270331b8C"), - Balance: convToHexOrDecimal256(new(big.Int).SetBytes(hexutil.MustDecode("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"))), - Energy: convToHexOrDecimal256(new(big.Int).SetBytes(hexutil.MustDecode("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"))), + Balance: convToHexOrDecimal256(consts.LargeBigValue), + Energy: convToHexOrDecimal256(consts.LargeBigValue), }, { Address: thor.MustParseAddress("0xD7f75A0A1287ab2916848909C8531a0eA9412800"), - Balance: convToHexOrDecimal256(new(big.Int).SetBytes(hexutil.MustDecode("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"))), - Energy: convToHexOrDecimal256(new(big.Int).SetBytes(hexutil.MustDecode("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"))), + Balance: convToHexOrDecimal256(consts.LargeBigValue), + Energy: convToHexOrDecimal256(consts.LargeBigValue), }, { Address: thor.MustParseAddress("0xAbEf6032B9176C186F6BF984f548bdA53349f70a"), - Balance: convToHexOrDecimal256(new(big.Int).SetBytes(hexutil.MustDecode("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"))), - Energy: convToHexOrDecimal256(new(big.Int).SetBytes(hexutil.MustDecode("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"))), + Balance: convToHexOrDecimal256(consts.LargeBigValue), + Energy: convToHexOrDecimal256(consts.LargeBigValue), }, { Address: thor.MustParseAddress("0x865306084235Bf804c8Bba8a8d56890940ca8F0b"), - Balance: convToHexOrDecimal256(new(big.Int).SetBytes(hexutil.MustDecode("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"))), - Energy: convToHexOrDecimal256(new(big.Int).SetBytes(hexutil.MustDecode("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"))), + Balance: convToHexOrDecimal256(consts.LargeBigValue), + Energy: convToHexOrDecimal256(consts.LargeBigValue), }, }, Authority: []genesis.Authority{ @@ -203,7 +203,7 @@ var localSixNodesNetworkGenesis = &genesis.CustomGenesis{ Params: genesis.Params{ RewardRatio: convToHexOrDecimal256(big.NewInt(300000000000000000)), BaseGasPrice: convToHexOrDecimal256(big.NewInt(1000000000000000)), - ProposerEndorsement: convToHexOrDecimal256(new(big.Int).SetBytes(hexutil.MustDecode("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"))), + ProposerEndorsement: convToHexOrDecimal256(consts.LargeBigValue), ExecutorAddress: &localThreeMasterEndorser, }, Executor: genesis.Executor{ diff --git a/preset/LocalThreeMasterNodes.go b/preset/LocalThreeMasterNodes.go index dc9bbad..197f814 100644 --- a/preset/LocalThreeMasterNodes.go +++ b/preset/LocalThreeMasterNodes.go @@ -3,7 +3,7 @@ package preset import ( "math/big" - "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/vechain/networkhub/consts" "github.com/vechain/networkhub/environments" "github.com/vechain/networkhub/network" "github.com/vechain/networkhub/network/node" @@ -19,7 +19,7 @@ var LocalThreeMasterNodesNetwork = &network.Network{ BaseNode: node.BaseNode{ ID: "node1", P2PListenPort: 8081, - APIAddr: "0.0.0.0:8181", + APIAddr: "127.0.0.1:8181", APICORS: "*", Type: node.MasterNode, Key: "01a4107bfb7d5141ec519e75788c34295741a1eefbfe460320efd2ada944071e", // 0x61fF580B63D3845934610222245C116E013717ec @@ -30,7 +30,7 @@ var LocalThreeMasterNodesNetwork = &network.Network{ BaseNode: node.BaseNode{ ID: "node2", P2PListenPort: 8082, - APIAddr: "0.0.0.0:8182", + APIAddr: "127.0.0.1:8182", APICORS: "*", Type: node.MasterNode, Key: "7072249b800ddac1d29a3cd06468cc1a917cbcd110dde358a905d03dad51748d", // 0x327931085B4cCbCE0baABb5a5E1C678707C51d90 @@ -41,7 +41,7 @@ var LocalThreeMasterNodesNetwork = &network.Network{ BaseNode: node.BaseNode{ ID: "node3", P2PListenPort: 8083, - APIAddr: "0.0.0.0:8183", + APIAddr: "127.0.0.1:8183", APICORS: "*", Type: node.MasterNode, Key: "c55455943bf026dc44fcf189e8765eb0587c94e66029d580bae795386c0b737a", // 0x084E48c8AE79656D7e27368AE5317b5c2D6a7497 @@ -60,7 +60,7 @@ var LocalThreeMasterNodesNetworkGenesis = &genesis.CustomGenesis{ Accounts: []genesis.Account{ { Address: thor.MustParseAddress("0x7567d83b7b8d80addcb281a71d54fc7b3364ffed"), - Balance: convToHexOrDecimal256(new(big.Int).SetBytes(hexutil.MustDecode("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"))), + Balance: convToHexOrDecimal256(consts.LargeBigValue), Energy: convToHexOrDecimal256(big.NewInt(0)), Code: "0x6060604052600256", Storage: map[string]thor.Bytes32{ @@ -69,18 +69,18 @@ var LocalThreeMasterNodesNetworkGenesis = &genesis.CustomGenesis{ }, { Address: thor.MustParseAddress("0x61fF580B63D3845934610222245C116E013717ec"), - Balance: convToHexOrDecimal256(new(big.Int).SetBytes(hexutil.MustDecode("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"))), - Energy: convToHexOrDecimal256(new(big.Int).SetBytes(hexutil.MustDecode("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"))), + Balance: convToHexOrDecimal256(consts.LargeBigValue), + Energy: convToHexOrDecimal256(consts.LargeBigValue), }, { Address: thor.MustParseAddress("0x327931085B4cCbCE0baABb5a5E1C678707C51d90"), - Balance: convToHexOrDecimal256(new(big.Int).SetBytes(hexutil.MustDecode("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"))), - Energy: convToHexOrDecimal256(new(big.Int).SetBytes(hexutil.MustDecode("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"))), + Balance: convToHexOrDecimal256(consts.LargeBigValue), + Energy: convToHexOrDecimal256(consts.LargeBigValue), }, { Address: thor.MustParseAddress("0x084E48c8AE79656D7e27368AE5317b5c2D6a7497"), - Balance: convToHexOrDecimal256(new(big.Int).SetBytes(hexutil.MustDecode("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"))), - Energy: convToHexOrDecimal256(new(big.Int).SetBytes(hexutil.MustDecode("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"))), + Balance: convToHexOrDecimal256(consts.LargeBigValue), + Energy: convToHexOrDecimal256(consts.LargeBigValue), }, }, Authority: []genesis.Authority{ @@ -103,7 +103,7 @@ var LocalThreeMasterNodesNetworkGenesis = &genesis.CustomGenesis{ Params: genesis.Params{ RewardRatio: convToHexOrDecimal256(big.NewInt(300000000000000000)), BaseGasPrice: convToHexOrDecimal256(big.NewInt(1000000000000000)), - ProposerEndorsement: convToHexOrDecimal256(new(big.Int).SetBytes(hexutil.MustDecode("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"))), + ProposerEndorsement: convToHexOrDecimal256(consts.LargeBigValue), ExecutorAddress: &localThreeMasterEndorser, }, Executor: genesis.Executor{