More constants to staking.go

pull/500/head
Rongjian Lan 6 years ago
parent 8f51d08f41
commit 44129b5c8e
  1. 11
      node/node.go
  2. 11
      node/staking.go

@ -99,17 +99,6 @@ type syncConfig struct {
client *downloader.Client client *downloader.Client
} }
//constants related to staking
//The first four bytes of the call data for a function call specifies the function to be called.
//It is the first (left, high-order in big-endian) four bytes of the Keccak-256 (SHA-3)
//Refer: https://solidity.readthedocs.io/en/develop/abi-spec.html
const (
depositFuncSignature = "0xd0e30db0"
withdrawFuncSignature = "0x2e1a7d4d"
funcSingatureBytes = 4
)
// Node represents a protocol-participating node in the network // Node represents a protocol-participating node in the network
type Node struct { type Node struct {
Consensus *consensus.Consensus // Consensus object containing all Consensus related data (e.g. committee members, signatures, commits) Consensus *consensus.Consensus // Consensus object containing all Consensus related data (e.g. committee members, signatures, commits)

@ -7,6 +7,17 @@ import (
"github.com/harmony-one/harmony/core/types" "github.com/harmony-one/harmony/core/types"
) )
//constants related to staking
//The first four bytes of the call data for a function call specifies the function to be called.
//It is the first (left, high-order in big-endian) four bytes of the Keccak-256 (SHA-3)
//Refer: https://solidity.readthedocs.io/en/develop/abi-spec.html
const (
depositFuncSignature = "0xd0e30db0"
withdrawFuncSignature = "0x2e1a7d4d"
funcSingatureBytes = 4
)
// UpdateStakingList updates the stakes of every node. // UpdateStakingList updates the stakes of every node.
// TODO: read directly from smart contract, or at least check the receipt also for incompleted transaction. // TODO: read directly from smart contract, or at least check the receipt also for incompleted transaction.
func (node *Node) UpdateStakingList(block *types.Block) error { func (node *Node) UpdateStakingList(block *types.Block) error {

Loading…
Cancel
Save