Documentation ¶
Index ¶
- Variables
- func BuildTxOpeningRandomize(nonce uint64, randomizeAddr common.Address, randomizeKey []byte) (*types.Transaction, error)
- func BuildTxSecretRandomize(nonce uint64, randomizeAddr common.Address, epocNumber uint64, ...) (*types.Transaction, error)
- func BuildValidatorFromM2(listM2 []int64) []byte
- func CalculateRewardForHolders(foundationWalletAddr common.Address, state *state.StateDB, ...) (error, map[common.Address]*big.Int)
- func CalculateRewardForSigner(chainReward *big.Int, signers map[common.Address]*rewardLog, ...) (map[common.Address]*big.Int, error)
- func CreateTransactionSign(chainConfig *params.ChainConfig, pool *core.TxPool, manager *accounts.Manager, ...) error
- func CreateTxSign(blockNumber *big.Int, blockHash common.Hash, nonce uint64, ...) *types.Transaction
- func DecodeValidatorsHexData(validatorsStr string) ([]int64, error)
- func Decrypt(key []byte, cryptoText string) string
- func DecryptRandomizeFromSecretsAndOpening(secrets [][32]byte, opening [32]byte) (int64, error)
- func Encrypt(key []byte, text string) string
- func GenM2FromRandomize(randomizes []int64, lenSigners int64) ([]int64, error)
- func GetCandidateCap(statedb *state.StateDB, parsed abi.ABI, candidate common.Address) string
- func GetCandidateOwner(statedb *state.StateDB, candidate common.Address) common.Address
- func GetCandidates(statedb *state.StateDB) []common.Address
- func GetCandidatesOwnerBySigner(state *state.StateDB, signerAddr common.Address) common.Address
- func GetOpening(statedb *state.StateDB, address common.Address) [32]byte
- func GetRandomizeFromContract(client bind.ContractBackend, addrMasternode common.Address) (int64, error)
- func GetRewardBalancesRate(foundationWalletAddr common.Address, state *state.StateDB, ...) (map[common.Address]*big.Int, error)
- func GetRewardForCheckpoint(c *posv.Posv, chain consensus.ChainReader, header *types.Header, ...) (map[common.Address]*rewardLog, error)
- func GetSecret(statedb *state.StateDB, address common.Address) [][32]byte
- func GetSigners(statedb *state.StateDB, block *types.Block) []common.Address
- func GetSignersByExecutingEVM(addrBlockSigner common.Address, client bind.ContractBackend, ...) ([]common.Address, error)
- func GetSignersFromContract(state *state.StateDB, block *types.Block) ([]common.Address, error)
- func GetVoterCap(state *state.StateDB, candidate, voter common.Address) *big.Int
- func GetVoters(statedb *state.StateDB, candidate common.Address) []common.Address
- func NewSlice(start int64, end int64, step int64) []int64
- func RandStringByte(n int) []byte
- func Shuffle(slice []int64) []int64
Constants ¶
This section is empty.
Variables ¶
View Source
var TxSignMu sync.RWMutex
Functions ¶
func BuildTxOpeningRandomize ¶ added in v0.3.0
func BuildTxOpeningRandomize(nonce uint64, randomizeAddr common.Address, randomizeKey []byte) (*types.Transaction, error)
Send opening to randomize SMC.
func BuildTxSecretRandomize ¶ added in v0.3.0
func BuildTxSecretRandomize(nonce uint64, randomizeAddr common.Address, epocNumber uint64, randomizeKey []byte) (*types.Transaction, error)
Send secret key into randomize smartcontract.
func BuildValidatorFromM2 ¶ added in v0.3.0
Get validators from m2 array integer.
func CalculateRewardForSigner ¶
func CalculateRewardForSigner(chainReward *big.Int, signers map[common.Address]*rewardLog, totalSigner uint64) (map[common.Address]*big.Int, error)
Calculate reward for signers.
func CreateTransactionSign ¶
func CreateTransactionSign(chainConfig *params.ChainConfig, pool *core.TxPool, manager *accounts.Manager, block *types.Block, chainDb ethdb.Database) error
Send tx sign for block number to smart contract blockSigner.
func CreateTxSign ¶
func CreateTxSign(blockNumber *big.Int, blockHash common.Hash, nonce uint64, blockSigner common.Address) *types.Transaction
Create tx sign.
func DecodeValidatorsHexData ¶ added in v0.3.0
Decode validator hex string.
func DecryptRandomizeFromSecretsAndOpening ¶ added in v0.3.0
Decrypt randomize from secrets and opening.
func GenM2FromRandomize ¶ added in v0.3.0
Generate m2 listing from randomize array.
func GetCandidateCap ¶ added in v1.2.0
func GetCandidateOwner ¶ added in v1.2.0
func GetCandidatesOwnerBySigner ¶
Get candidate owner by address.
func GetOpening ¶ added in v1.2.0
func GetRandomizeFromContract ¶ added in v0.3.0
func GetRandomizeFromContract(client bind.ContractBackend, addrMasternode common.Address) (int64, error)
Get random from randomize contract.
func GetRewardBalancesRate ¶
func GetRewardForCheckpoint ¶
func GetRewardForCheckpoint(c *posv.Posv, chain consensus.ChainReader, header *types.Header, rCheckpoint uint64, totalSigner *uint64) (map[common.Address]*rewardLog, error)
Calculate reward for reward checkpoint.
func GetSigners ¶ added in v1.2.0
func GetSignersByExecutingEVM ¶ added in v1.2.0
func GetSignersByExecutingEVM(addrBlockSigner common.Address, client bind.ContractBackend, blockHash common.Hash) ([]common.Address, error)
Get signers signed for blockNumber from blockSigner contract.
func GetSignersFromContract ¶
Get signers signed for blockNumber from blockSigner contract.
func GetVoterCap ¶ added in v1.2.0
Types ¶
This section is empty.
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package chequebook package wraps the 'chequebook' Ethereum smart contract.
|
Package chequebook package wraps the 'chequebook' Ethereum smart contract. |
Click to show internal directories.
Click to hide internal directories.