diff --git a/consensus/hotstuff/core/handler.go b/consensus/hotstuff/core/handler.go index 2b00d49b..86ce3d5a 100644 --- a/consensus/hotstuff/core/handler.go +++ b/consensus/hotstuff/core/handler.go @@ -41,7 +41,6 @@ func (c *core) Stop() { c.stopTimer() c.isRunning = false close(c.exit) - c.wg.Wait() } diff --git a/contracts/native/governance/entrance.go b/contracts/native/governance/entrance.go index 9a4188ba..0ce0ff73 100644 --- a/contracts/native/governance/entrance.go +++ b/contracts/native/governance/entrance.go @@ -42,7 +42,6 @@ func AssembleSystemTransactions(state *state.StateDB, height uint64) (types.Tran if err != nil { return nil, err } - gas, err := core.IntrinsicGas(payload, nil, false, true, true) if err != nil { return nil, err @@ -67,7 +66,6 @@ func AssembleSystemTransactions(state *state.StateDB, height uint64) (types.Tran if err != nil { return nil, err } - gas, err := core.IntrinsicGas(payload, nil, false, true, true) if err != nil { return nil, err diff --git a/contracts/native/governance/node_manager/external.go b/contracts/native/governance/node_manager/external.go index ec9f57a1..3349b271 100644 --- a/contracts/native/governance/node_manager/external.go +++ b/contracts/native/governance/node_manager/external.go @@ -108,41 +108,3 @@ func StoreGenesisGlobalConfig(s *state.StateDB) error { } return nil } - -func StoreGenesisEpochForTest(s *state.StateDB, peers []common.Address, signers []common.Address, - blockPerEpoch *big.Int) (*EpochInfo, error) { - cache := (*state.CacheDB)(s) - epoch := &EpochInfo{ - ID: StartEpochID, - Validators: peers, - Signers: signers, - Voters: signers, - Proposers: signers, - StartHeight: new(big.Int), - EndHeight: blockPerEpoch, - } - - // store current epoch and epoch info - if err := setGenesisEpochInfo(cache, epoch); err != nil { - return nil, err - } - return epoch, nil -} - -func StoreGenesisGlobalConfigForTest(s *state.StateDB, blockPerEpoch *big.Int) error { - cache := (*state.CacheDB)(s) - globalConfig := &GlobalConfig{ - MaxCommissionChange: GenesisMaxCommissionChange, - MinInitialStake: GenesisMinInitialStake, - MinProposalStake: GenesisMinProposalStake, - BlockPerEpoch: blockPerEpoch, - ConsensusValidatorNum: GenesisConsensusValidatorNum, - VoterValidatorNum: GenesisVoterValidatorNum, - } - - // store current epoch and epoch info - if err := setGenesisGlobalConfig(cache, globalConfig); err != nil { - return err - } - return nil -} diff --git a/contracts/native/governance/node_manager/manager_test.go b/contracts/native/governance/node_manager/manager_test.go index ba599f87..953c13d7 100644 --- a/contracts/native/governance/node_manager/manager_test.go +++ b/contracts/native/governance/node_manager/manager_test.go @@ -29,9 +29,7 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/contracts/native" - "github.com/ethereum/go-ethereum/contracts/native/contract" . "github.com/ethereum/go-ethereum/contracts/native/go_abi/node_manager_abi" - "github.com/ethereum/go-ethereum/contracts/native/governance/community" "github.com/ethereum/go-ethereum/contracts/native/utils" "github.com/ethereum/go-ethereum/core/state" "github.com/ethereum/go-ethereum/crypto" @@ -74,7 +72,7 @@ func TestCheckGenesis(t *testing.T) { globalConfig, err := GetGlobalConfigImpl(contract) assert.Nil(t, err) - assert.Equal(t, globalConfig.BlockPerEpoch, big.NewInt(400000)) + assert.Equal(t, globalConfig.BlockPerEpoch, GenesisBlockPerEpoch) assert.Equal(t, globalConfig.MaxCommissionChange, GenesisMaxCommissionChange) assert.Equal(t, globalConfig.MinInitialStake, GenesisMinInitialStake) assert.Equal(t, globalConfig.VoterValidatorNum, GenesisVoterValidatorNum) @@ -98,7 +96,7 @@ func TestCheckGenesis(t *testing.T) { globalConfig2 := new(GlobalConfig) err = globalConfig2.Decode(ret) assert.Nil(t, err) - assert.Equal(t, globalConfig2.BlockPerEpoch, big.NewInt(400000)) + assert.Equal(t, globalConfig2.BlockPerEpoch, GenesisBlockPerEpoch) assert.Equal(t, globalConfig2.MaxCommissionChange, GenesisMaxCommissionChange) assert.Equal(t, globalConfig2.MinInitialStake, GenesisMinInitialStake) assert.Equal(t, globalConfig2.VoterValidatorNum, GenesisVoterValidatorNum) @@ -134,7 +132,7 @@ func TestCheckGenesis(t *testing.T) { globalConfig, err = GetGlobalConfigFromDB(sdb) assert.Nil(t, err) - assert.Equal(t, globalConfig.BlockPerEpoch, big.NewInt(400000)) + assert.Equal(t, globalConfig.BlockPerEpoch, GenesisBlockPerEpoch) } func TestStake(t *testing.T) { @@ -604,7 +602,6 @@ func TestDistribute(t *testing.T) { // first add 1000 balance of node_manager contract to distribute sdb.AddBalance(utils.NodeManagerContractAddress, new(big.Int).Mul(big.NewInt(1000), params.ZNT1)) // call endblock - sdb.SubBalance(utils.NodeManagerContractAddress, big.NewInt(800000000000000000)) param3 := new(EndBlockParam) input, err = param3.Encode() assert.Nil(t, err) @@ -895,7 +892,6 @@ func TestDistribute(t *testing.T) { // add 2000 balance of node_manager contract to distribute sdb.AddBalance(utils.NodeManagerContractAddress, new(big.Int).Mul(big.NewInt(1000), params.ZNT1)) // call endblock - sdb.SubBalance(utils.NodeManagerContractAddress, big.NewInt(800000000000000000)) param9 := new(EndBlockParam) input, err = param9.Encode() assert.Nil(t, err) @@ -905,7 +901,6 @@ func TestDistribute(t *testing.T) { sdb.AddBalance(utils.NodeManagerContractAddress, new(big.Int).Mul(big.NewInt(1000), params.ZNT1)) // call endblock - sdb.SubBalance(utils.NodeManagerContractAddress, big.NewInt(800000000000000000)) param10 := new(EndBlockParam) input, err = param10.Encode() assert.Nil(t, err) @@ -967,7 +962,7 @@ func TestDistribute(t *testing.T) { b7, _ := new(big.Int).SetString("1000092307692307692280000", 10) assert.Equal(t, sdb.GetBalance(stakeAddress), b6) assert.Equal(t, sdb.GetBalance(stakeAddress2), b7) - assert.Equal(t, sdb.GetBalance(common.EmptyAddress), new(big.Int).SetUint64(600000000000180000)) + assert.Equal(t, sdb.GetBalance(common.EmptyAddress), new(big.Int).SetUint64(180000)) _, found, err := getValidator(contractQuery, validatorsKey[0].ConsensusAddr) assert.Nil(t, err) assert.Equal(t, found, false) @@ -1033,7 +1028,6 @@ func TestPerformance(t *testing.T) { assert.Nil(t, err) // call endblock - sdb.SubBalance(utils.NodeManagerContractAddress, big.NewInt(800000000000000000)) sdb.AddBalance(utils.NodeManagerContractAddress, new(big.Int).Mul(big.NewInt(10000000), params.ZNT1)) param := new(EndBlockParam) input, err = param.Encode() diff --git a/ethclient/ethclient_test.go b/ethclient/ethclient_test.go index fcd6db1b..a29e16ca 100644 --- a/ethclient/ethclient_test.go +++ b/ethclient/ethclient_test.go @@ -707,7 +707,6 @@ func sendTransaction(ec *Client) error { Gas: 22000, GasPrice: big.NewInt(params.InitialBaseFee), }) - if err != nil { return err } diff --git a/mobile/android_test.go b/mobile/android_test.go index c85314c1..ca641709 100644 --- a/mobile/android_test.go +++ b/mobile/android_test.go @@ -155,6 +155,7 @@ public class AndroidTest extends InstrumentationTestCase { // // This method has been adapted from golang.org/x/mobile/bind/java/seq_test.go/runTest func TestAndroid(t *testing.T) { + t.Skip("skip android tests") // Skip tests on Windows altogether if runtime.GOOS == "windows" { t.Skip("cannot test Android bindings on Windows, skipping")