diff --git a/cmd/client/wallet/main.go b/cmd/client/wallet/main.go index a9a06b5c9..4be03bb3d 100644 --- a/cmd/client/wallet/main.go +++ b/cmd/client/wallet/main.go @@ -732,7 +732,7 @@ func processTransferCommand() { fmt.Printf("Unlock account succeeded! '%v'\n", senderPass) - tx, err = ks.SignTx(account, tx, nil) + tx, err = ks.SignTx(account, tx, big.NewInt(1)) if err != nil { fmt.Printf("SignTx Error: %v\n", err) return diff --git a/core/blockchain.go b/core/blockchain.go index cff84d4cc..e1da6d7ed 100644 --- a/core/blockchain.go +++ b/core/blockchain.go @@ -407,7 +407,7 @@ func (bc *BlockChain) FastSyncCommitHead(hash common.Hash) error { // ShardID returns the shard Id of the blockchain. func (bc *BlockChain) ShardID() uint32 { - return uint32(bc.chainConfig.ChainID.Int64()) + return bc.CurrentBlock().ShardID() } // GasLimit returns the gas limit of the current HEAD block. diff --git a/internal/shardchain/shardchains.go b/internal/shardchain/shardchains.go index a3d09d1c4..22dbb156d 100644 --- a/internal/shardchain/shardchains.go +++ b/internal/shardchain/shardchains.go @@ -105,7 +105,8 @@ func (sc *CollectionImpl) ShardChain(shardID uint32, networkType nodeconfig.Netw chainConfig = *params.TestnetChainConfig } - chainConfig.ChainID = big.NewInt(int64(shardID)) + // TODO: use 1 as mainnet, change to networkID instead + chainConfig.ChainID = big.NewInt(1) bc, err := core.NewBlockChain( db, cacheConfig, &chainConfig, sc.engine, vm.Config{}, nil, diff --git a/node/node_genesis.go b/node/node_genesis.go index 61f5a0657..d00c88a1a 100644 --- a/node/node_genesis.go +++ b/node/node_genesis.go @@ -93,8 +93,8 @@ func (node *Node) SetupGenesisBlock(db ethdb.Database, shardID uint32, myShardSt } // Initialize shard state - // TODO: add ShardIDs into chainconfig and change ChainID to NetworkID - chainConfig.ChainID = big.NewInt(int64(shardID)) // Use ChainID as piggybacked ShardIDs + // TODO: use 1 for now as mainnet, change to networkID instead + chainConfig.ChainID = big.NewInt(1) gspec := core.Genesis{ Config: &chainConfig,