Skip to content

Commit

Permalink
Merge pull request polynetwork#50 from siovanus/dev2.0
Browse files Browse the repository at this point in the history
update
  • Loading branch information
dylenfu authored Jul 22, 2022
2 parents b86cd46 + 7798667 commit 6a214cd
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
2 changes: 0 additions & 2 deletions contracts/native/boot/boot.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import (
"github.com/ethereum/go-ethereum/contracts/native/governance/neo3_state_manager"
"github.com/ethereum/go-ethereum/contracts/native/governance/node_manager"
"github.com/ethereum/go-ethereum/contracts/native/governance/proposal_manager"
"github.com/ethereum/go-ethereum/contracts/native/governance/relayer_manager"
"github.com/ethereum/go-ethereum/contracts/native/governance/side_chain_manager"
"github.com/ethereum/go-ethereum/contracts/native/governance/signature_manager"
"github.com/ethereum/go-ethereum/contracts/native/info_sync"
Expand All @@ -37,7 +36,6 @@ func InitNativeContracts() {
info_sync.InitInfoSync()
cross_chain_manager.InitCrossChainManager()
side_chain_manager.InitSideChainManager()
relayer_manager.InitRelayerManager()
neo3_state_manager.InitNeo3StateManager()
signature_manager.InitSignatureManager()
proposal_manager.InitProposalManager()
Expand Down
6 changes: 5 additions & 1 deletion contracts/native/governance/node_manager/manager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ var (
testGenesisPeers []common.Address
)

func init() {
func Init() {
key, _ := crypto.GenerateKey()
acct = &key.PublicKey

Expand All @@ -53,6 +53,7 @@ func init() {
}

func TestCheckGenesis(t *testing.T) {
Init()
// check get spec methodID
m := GetSpecMethodID()
assert.Equal(t, m["fe6f86f8"], true)
Expand Down Expand Up @@ -130,6 +131,7 @@ func TestCheckGenesis(t *testing.T) {
}

func TestStake(t *testing.T) {
Init()
blockNumber := big.NewInt(399999)
extra := uint64(10)
contractRefQuery := native.NewContractRef(sdb, common.EmptyAddress, common.EmptyAddress, blockNumber, common.Hash{}, extra, nil)
Expand Down Expand Up @@ -419,6 +421,7 @@ func TestStake(t *testing.T) {
}

func TestDistribute(t *testing.T) {
Init()
blockNumber := big.NewInt(399999)
extra := uint64(10)
contractRefQuery := native.NewContractRef(sdb, common.EmptyAddress, common.EmptyAddress, blockNumber, common.Hash{}, extra, nil)
Expand Down Expand Up @@ -837,6 +840,7 @@ func TestDistribute(t *testing.T) {
}

func TestPerformance(t *testing.T) {
Init()
blockNumber := 399999
extra := uint64(10)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ func TestUpdateNodeManagerGlobalConfig(t *testing.T) {

globalConfig, err := node_manager.GetGlobalConfigImpl(contract)
assert.Nil(t, err)
assert.Equal(t, globalConfig.MaxDescLength, node_manager.GenesisMaxDescLength)
assert.Equal(t, globalConfig.BlockPerEpoch, node_manager.GenesisBlockPerEpoch)
assert.Equal(t, globalConfig.MaxCommissionChange, node_manager.GenesisMaxCommissionChange)
assert.Equal(t, globalConfig.MinInitialStake, node_manager.GenesisMinInitialStake)
Expand Down
5 changes: 4 additions & 1 deletion contracts/native/info_sync/entrance_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ const (
CHAIN_ID uint64 = 1
)

func init() {
func Init() {
key, _ = crypto.GenerateKey()
pub = &key.PublicKey

Expand Down Expand Up @@ -88,6 +88,7 @@ func putSideChain() {
}

func TestNoAuthSyncRootInfo(t *testing.T) {
Init()
var err error
param := new(SyncRootInfoParam)
param.ChainID = CHAIN_ID
Expand All @@ -114,6 +115,7 @@ func TestNoAuthSyncRootInfo(t *testing.T) {
}

func TestNormalSyncRootInfo(t *testing.T) {
Init()
var err error
param := new(SyncRootInfoParam)
param.ChainID = CHAIN_ID
Expand Down Expand Up @@ -176,6 +178,7 @@ func TestNormalSyncRootInfo(t *testing.T) {
}

func TestReplenish(t *testing.T) {
Init()
param := &ReplenishParam{
ChainID: CHAIN_ID,
Heights: []uint32{100, 90},
Expand Down

0 comments on commit 6a214cd

Please sign in to comment.