Documentation
¶
Index ¶
- Constants
- Variables
- func CombineV(txType uint8, version uint8, chainID uint16) *big.Int
- func ParseV(V *big.Int) (txType uint8, version uint8, secp256k1V uint8, chainID uint16)
- func RegisterChangeLog(logType ChangeLogType, TypeName string, ...)
- func SetSecp256k1V(V *big.Int, secp256k1V byte) *big.Int
- type AccountAccessor
- type AccountData
- func (a *AccountData) Clone() NodeData
- func (a *AccountData) Copy() *AccountData
- func (a *AccountData) DecodeRLP(s *rlp.Stream) error
- func (a *AccountData) EncodeRLP(w io.Writer) error
- func (a AccountData) MarshalJSON() ([]byte, error)
- func (a *AccountData) String() string
- func (a *AccountData) UnmarshalJSON(input []byte) error
- type Asset
- type AssetEquity
- type Block
- func (b *Block) AppendConfirm(confirms ...SignData)
- func (b *Block) Copy() *Block
- func (b *Block) Extra() []byte
- func (b *Block) GasLimit() uint64
- func (b *Block) GasUsed() uint64
- func (b *Block) Hash() common.Hash
- func (b *Block) Height() uint32
- func (b *Block) IsConfirmExist(confirm SignData) bool
- func (b *Block) Json() string
- func (b *Block) LogsHash() common.Hash
- func (b Block) MarshalJSON() ([]byte, error)
- func (b *Block) MinerAddress() common.Address
- func (b *Block) ParentHash() common.Hash
- func (b *Block) SetChangeLogs(logs []*ChangeLog)
- func (b *Block) SetConfirms(confirms []SignData)
- func (b *Block) SetDeputyNodes(deputyNodes deputynode.DeputyNodes)
- func (b *Block) SetHeader(header *Header)
- func (b *Block) SetTxs(txs []*Transaction)
- func (b *Block) SignData() []byte
- func (b *Block) Size() int
- func (b *Block) String() string
- func (b *Block) Time() uint32
- func (b *Block) TxHash() common.Hash
- func (b *Block) UnmarshalJSON(input []byte) error
- func (b *Block) VersionRoot() common.Hash
- type Blocks
- type Candidate
- type ChangeLog
- func (c *ChangeLog) Copy() *ChangeLog
- func (c *ChangeLog) DecodeRLP(s *rlp.Stream) (err error)
- func (c *ChangeLog) EncodeRLP(w io.Writer) error
- func (c *ChangeLog) Hash() (h common.Hash)
- func (c ChangeLog) MarshalJSON() ([]byte, error)
- func (c *ChangeLog) Redo(processor ChangeLogProcessor) error
- func (c *ChangeLog) String() string
- func (c *ChangeLog) Undo(processor ChangeLogProcessor) error
- func (c *ChangeLog) UnmarshalJSON(input []byte) error
- type ChangeLogProcessor
- type ChangeLogSlice
- type ChangeLogType
- type Code
- type DefaultSigner
- type Event
- type EventForStorage
- type GasPayerSigner
- type GasPool
- type Header
- type IssueAsset
- type ModifyAssetInfo
- type NodeData
- type Pair
- type Profile
- type ReimbursementTxSigner
- type ReplenishAsset
- type SignData
- type Signer
- type TradingAsset
- type Transaction
- func GasPayerSignatureTx(tx *Transaction, gasPrice *big.Int, gasLimit uint64) *Transaction
- func NewContractCreation(amount *big.Int, gasLimit uint64, gasPrice *big.Int, data []byte, ...) *Transaction
- func NewReimbursementContractCreation(gasPayer common.Address, amount *big.Int, data []byte, TxType uint16, ...) *Transaction
- func NewReimbursementTransaction(to, gasPayer common.Address, amount *big.Int, data []byte, TxType uint16, ...) *Transaction
- func NewTransaction(to common.Address, amount *big.Int, gasLimit uint64, gasPrice *big.Int, ...) *Transaction
- func NoReceiverTransaction(amount *big.Int, gasLimit uint64, gasPrice *big.Int, data []byte, ...) *Transaction
- func (tx *Transaction) Amount() *big.Int
- func (tx *Transaction) ChainID() uint16
- func (tx *Transaction) Clone() *Transaction
- func (tx *Transaction) Cost() *big.Int
- func (tx *Transaction) Data() []byte
- func (tx *Transaction) DecodeRLP(s *rlp.Stream) error
- func (tx *Transaction) EncodeRLP(w io.Writer) error
- func (tx *Transaction) Expiration() uint64
- func (tx *Transaction) From() (common.Address, error)
- func (tx *Transaction) GasLimit() uint64
- func (tx *Transaction) GasPayer() (common.Address, error)
- func (tx *Transaction) GasPayerSig() []byte
- func (tx *Transaction) GasPrice() *big.Int
- func (tx *Transaction) Hash() common.Hash
- func (tx *Transaction) MarshalJSON() ([]byte, error)
- func (tx *Transaction) Message() string
- func (tx *Transaction) Sig() []byte
- func (tx *Transaction) String() string
- func (tx *Transaction) To() *common.Address
- func (tx *Transaction) ToName() string
- func (tx *Transaction) Type() uint16
- func (tx *Transaction) UnmarshalJSON(input []byte) error
- func (tx *Transaction) Version() uint8
- type Transactions
- type VersionRecord
Constants ¶
const ( // candidate profile CandidateKeyIsCandidate string = "isCandidate" CandidateKeyNodeID string = "nodeID" CandidateKeyHost string = "host" CandidateKeyPort string = "port" CandidateKeyIncomeAddress string = "incomeAddress" // asset profile AssetName string = "name" AssetSymbol string = "symbol" AssetDescription string = "description" AssetStop string = "stop" AssetSuggestedGasLimit string = "suggestedGasLimit" )
const ( Asset01 = uint32(1) // erc20 Asset02 = uint32(2) // erc721 Asset03 = uint32(3) // erc20+721 MaxMarshalAssetLength = 680 MaxMetaDataLength = 256 )
const (
TxSigLength = 65
)
Variables ¶
var ( ErrUnknownChangeLogType = errors.New("unknown change log type") // ErrWrongChangeLogVersion is returned by the ChangeLog Undo/Redo if account has an unexpected version ErrWrongChangeLogVersion = errors.New("the version of change log and account is not match") ErrAlreadyRedo = errors.New("the change log's version is lower than account's. maybe it has redid") ErrWrongChangeLogData = errors.New("change log data is incorrect") )
var ( // ErrKnownBlock is returned when a block to import is already known locally. ErrKnownBlock = errors.New("block already known") // ErrGasLimitReached is returned by the gas pool if the amount of gas required // by a transaction is higher than what's left in the block. ErrGasLimitReached = errors.New("block gas limit reached") // ErrBlacklistedHash is returned if a block to import is on the blacklist. ErrBlacklistedHash = errors.New("blacklisted hash") )
var ( TopicContractCreation = rlpHash("Contract creation") TopicRunFail = rlpHash("Contract run fail") )
var ( DefaultTTTL uint64 = 2 * 60 * 60 // Transaction Time To Live, 2hours ErrInvalidSig = errors.New("invalid transaction sig") ErrInvalidVersion = errors.New("invalid transaction version") TxVersion uint8 = 1 // current transaction version. should between 0 and 128 )
var (
ErrPublicKey = errors.New("invalid public key")
)
Functions ¶
func RegisterChangeLog ¶
func RegisterChangeLog(logType ChangeLogType, TypeName string, newValDecoder, extraDecoder changeLogDecoder, redo, undo changeLogDoFunc)
Types ¶
type AccountAccessor ¶
type AccountAccessor interface {
GetAddress() common.Address
GetVersion(logType ChangeLogType) uint32
GetNextVersion(logType ChangeLogType) uint32
GetVoteFor() common.Address
SetVoteFor(addr common.Address)
GetVotes() *big.Int
SetVotes(votes *big.Int)
GetCandidate() Profile
SetCandidate(profile Profile)
GetCandidateState(key string) string
SetCandidateState(key string, val string)
GetBalance() *big.Int
SetBalance(balance *big.Int)
GetCodeHash() common.Hash
SetCodeHash(codeHash common.Hash)
GetCode() (Code, error)
SetCode(code Code)
GetStorageRoot() common.Hash
SetStorageRoot(root common.Hash)
GetAssetCodeRoot() common.Hash
SetAssetCodeRoot(root common.Hash)
GetAssetIdRoot() common.Hash
SetAssetIdRoot(root common.Hash)
GetEquityRoot() common.Hash
SetEquityRoot(root common.Hash)
GetStorageState(key common.Hash) ([]byte, error)
SetStorageState(key common.Hash, value []byte) error
GetAssetCode(code common.Hash) (*Asset, error)
SetAssetCode(code common.Hash, asset *Asset) error
GetAssetCodeTotalSupply(code common.Hash) (*big.Int, error)
SetAssetCodeTotalSupply(code common.Hash, val *big.Int) error
GetAssetCodeState(code common.Hash, key string) (string, error)
SetAssetCodeState(code common.Hash, key string, val string) error
GetAssetIdState(id common.Hash) (string, error)
SetAssetIdState(id common.Hash, data string) error
GetEquityState(id common.Hash) (*AssetEquity, error)
SetEquityState(id common.Hash, equity *AssetEquity) error
PushEvent(event *Event)
PopEvent() error
GetEvents() []*Event
GetSuicide() bool
SetSuicide(suicided bool)
IsEmpty() bool
MarshalJSON() ([]byte, error)
}
type AccountData ¶
type AccountData struct {
Address common.Address `json:"address" gencodec:"required"`
Balance *big.Int `json:"balance" gencodec:"required"`
CodeHash common.Hash `json:"codeHash" gencodec:"required"`
StorageRoot common.Hash `json:"root" gencodec:"required"`
AssetCodeRoot common.Hash `json:"assetCodeRoot" gencodec:"required"`
AssetIdRoot common.Hash `json:"assetIdRoot" gencodec:"required"`
EquityRoot common.Hash `json:"equityRoot" gencodec:"required"`
VoteFor common.Address `json:"voteFor"`
Candidate Candidate `json:"candidate"`
// It records the block height which contains any type of newest change log. It is updated in finalize step
NewestRecords map[ChangeLogType]VersionRecord `json:"records" gencodec:"required"`
}
func (*AccountData) Clone ¶ added in v1.1.1
func (a *AccountData) Clone() NodeData
func (*AccountData) Copy ¶
func (a *AccountData) Copy() *AccountData
func (*AccountData) DecodeRLP ¶
func (a *AccountData) DecodeRLP(s *rlp.Stream) error
DecodeRLP implements rlp.Decoder.
func (*AccountData) EncodeRLP ¶
func (a *AccountData) EncodeRLP(w io.Writer) error
EncodeRLP implements rlp.Encoder.
func (AccountData) MarshalJSON ¶
func (a AccountData) MarshalJSON() ([]byte, error)
MarshalJSON marshals as JSON.
func (*AccountData) String ¶
func (a *AccountData) String() string
func (*AccountData) UnmarshalJSON ¶
func (a *AccountData) UnmarshalJSON(input []byte) error
UnmarshalJSON unmarshals from JSON.
type Asset ¶ added in v1.2.0
type AssetEquity ¶ added in v1.2.0
type AssetEquity struct {
AssetCode common.Hash `json:"assetCode" gencodec:"required"`
AssetId common.Hash `json:"assetId" gencodec:"required"`
Equity *big.Int `json:"equity" gencodec:"required"`
}
type AssetExtend struct {
MateData map[common.Hash]string
}
func (*AssetEquity) Clone ¶ added in v1.2.0
func (equity *AssetEquity) Clone() *AssetEquity
func (AssetEquity) MarshalJSON ¶ added in v1.2.0
func (a AssetEquity) MarshalJSON() ([]byte, error)
MarshalJSON marshals as JSON.
func (*AssetEquity) String ¶ added in v1.2.0
func (equity *AssetEquity) String() string
func (*AssetEquity) UnmarshalJSON ¶ added in v1.2.0
func (a *AssetEquity) UnmarshalJSON(input []byte) error
UnmarshalJSON unmarshals from JSON.
type Block ¶
type Block struct {
Header *Header `json:"header" gencodec:"required"`
Txs Transactions `json:"transactions" gencodec:"required"`
ChangeLogs ChangeLogSlice `json:"changeLogs" gencodec:"required"`
Confirms []SignData `json:"confirms"`
DeputyNodes deputynode.DeputyNodes `json:"deputyNodes"`
}
Block
func (*Block) AppendConfirm ¶ added in v1.2.0
func (*Block) IsConfirmExist ¶ added in v1.2.0
func (Block) MarshalJSON ¶
MarshalJSON marshals as JSON.
func (*Block) MinerAddress ¶
func (*Block) ParentHash ¶
func (*Block) SetChangeLogs ¶
func (*Block) SetConfirms ¶
func (*Block) SetDeputyNodes ¶
func (b *Block) SetDeputyNodes(deputyNodes deputynode.DeputyNodes)
func (*Block) SetTxs ¶
func (b *Block) SetTxs(txs []*Transaction)
func (*Block) UnmarshalJSON ¶
UnmarshalJSON unmarshals from JSON.
func (*Block) VersionRoot ¶
type Candidate ¶ added in v1.1.0
func (Candidate) MarshalJSON ¶ added in v1.1.0
MarshalJSON marshals as JSON.
func (*Candidate) UnmarshalJSON ¶ added in v1.1.0
UnmarshalJSON unmarshals from JSON.
type ChangeLog ¶
type ChangeLog struct {
LogType ChangeLogType `json:"type" gencodec:"required"`
Address common.Address `json:"address" gencodec:"required"`
// The No. of ChangeLog in an account
Version uint32 `json:"version" gencodec:"required"`
// data pointer. Their content type depend on specific NewXXXLog function
OldVal interface{} `json:"-"` // It's used for undo. So no need to save or send to others
NewVal interface{} `json:"newValue"`
Extra interface{} `json:"extra"`
}
func (ChangeLog) MarshalJSON ¶
MarshalJSON marshals as JSON.
func (*ChangeLog) Redo ¶
func (c *ChangeLog) Redo(processor ChangeLogProcessor) error
Redo reply the change for light client. Its behavior depends on ChangeLog.ChangeLogType
func (*ChangeLog) Undo ¶
func (c *ChangeLog) Undo(processor ChangeLogProcessor) error
Undo reverts the change. Its behavior depends on ChangeLog.ChangeLogType
func (*ChangeLog) UnmarshalJSON ¶
UnmarshalJSON unmarshals from JSON.
type ChangeLogProcessor ¶
type ChangeLogProcessor interface {
GetAccount(addr common.Address) AccountAccessor
}
ChangeLogProcessor is used to access account, and the intermediate data generated by transactions. It is implemented by account.Manager
type ChangeLogSlice ¶
type ChangeLogSlice []*ChangeLog
func (ChangeLogSlice) FindByType ¶
func (c ChangeLogSlice) FindByType(target *ChangeLog) *ChangeLog
FindByType find the first same type change log.
func (ChangeLogSlice) Len ¶
func (c ChangeLogSlice) Len() int
func (ChangeLogSlice) Less ¶
func (c ChangeLogSlice) Less(i, j int) bool
func (ChangeLogSlice) MerkleRootSha ¶ added in v1.2.0
func (c ChangeLogSlice) MerkleRootSha() common.Hash
MerkleRootSha compute the root hash of ChangeLog merkle trie
func (ChangeLogSlice) Search ¶
func (c ChangeLogSlice) Search(version uint32) int
func (ChangeLogSlice) Swap ¶
func (c ChangeLogSlice) Swap(i, j int)
type ChangeLogType ¶
type ChangeLogType uint32
func (ChangeLogType) String ¶
func (t ChangeLogType) String() string
type DefaultSigner ¶
type DefaultSigner struct {
}
DefaultSigner implements Signer.
func (DefaultSigner) GetSigner ¶ added in v1.1.1
func (s DefaultSigner) GetSigner(tx *Transaction) (common.Address, error)
func (DefaultSigner) Hash ¶
func (s DefaultSigner) Hash(tx *Transaction) common.Hash
Hash returns the hash to be signed by the sender. It does not uniquely identify the transaction.
func (DefaultSigner) SignTx ¶ added in v1.1.1
func (s DefaultSigner) SignTx(tx *Transaction, prv *ecdsa.PrivateKey) (*Transaction, error)
type Event ¶
type Event struct {
// Consensus fields:
// address of the contract that generated the event
Address common.Address `json:"address" gencodec:"required"`
// list of topics provided by the contract.
Topics []common.Hash `json:"topics" gencodec:"required"`
// supplied by the contract, usually ABI-encoded
Data []byte `json:"data" gencodec:"required"`
// Derived fields. These fields are filled in by the node
// but not secured by consensus.
// block in which the transaction was included
// hash of the transaction
TxHash common.Hash `json:"transactionHash" gencodec:"required"`
// index of the transaction in the block
TxIndex uint `json:"transactionIndex" gencodec:"required"`
// index of the event in the receipt
Index uint `json:"eventIndex" gencodec:"required"`
// The Removed field is true if this event was reverted due to a chain reorganisation.
// You must pay attention to this field if you receive Events through a filter query.
Removed bool `json:"removed"`
}
Event represents a contract event event. These Events are generated by the LOG opcode and stored/indexed by the node.
func (Event) MarshalJSON ¶
MarshalJSON marshals as JSON.
func (*Event) UnmarshalJSON ¶
UnmarshalJSON unmarshals from JSON.
type EventForStorage ¶
type EventForStorage Event
EventForStorage is a wrapper around a Event that flattens and parses the entire content of a event including non-consensus fields.
type GasPayerSigner ¶ added in v1.1.1
type GasPayerSigner struct {
}
func (GasPayerSigner) GetSigner ¶ added in v1.1.1
func (g GasPayerSigner) GetSigner(tx *Transaction) (common.Address, error)
GetGasPayer returns gas payer address
func (GasPayerSigner) Hash ¶ added in v1.1.1
func (g GasPayerSigner) Hash(tx *Transaction) common.Hash
Hash returns sign hash
func (GasPayerSigner) SignTx ¶ added in v1.1.1
func (g GasPayerSigner) SignTx(tx *Transaction, prv *ecdsa.PrivateKey) (*Transaction, error)
SignTx returns last signature to reimbursement gas transaction
type Header ¶
type Header struct {
ParentHash common.Hash `json:"parentHash" gencodec:"required"`
MinerAddress common.Address `json:"miner" gencodec:"required"`
VersionRoot common.Hash `json:"versionRoot" gencodec:"required"`
TxRoot common.Hash `json:"transactionRoot" gencodec:"required"`
LogRoot common.Hash `json:"changeLogRoot" gencodec:"required"`
Height uint32 `json:"height" gencodec:"required"`
GasLimit uint64 `json:"gasLimit" gencodec:"required"`
GasUsed uint64 `json:"gasUsed" gencodec:"required"`
Time uint32 `json:"timestamp" gencodec:"required"`
SignData []byte `json:"signData" gencodec:"required"`
DeputyRoot []byte `json:"deputyRoot"`
Extra []byte `json:"extraData"` // max length is 256 bytes
}
func (Header) MarshalJSON ¶
MarshalJSON marshals as JSON.
func (*Header) UnmarshalJSON ¶
UnmarshalJSON unmarshals from JSON.
type IssueAsset ¶ added in v1.2.0
tx data marshal unmarshal struct 发行资产
type ModifyAssetInfo ¶ added in v1.2.0
修改资产profile
type ReimbursementTxSigner ¶ added in v1.1.1
type ReimbursementTxSigner struct {
}
func (ReimbursementTxSigner) GetSigner ¶ added in v1.1.1
func (s ReimbursementTxSigner) GetSigner(tx *Transaction) (common.Address, error)
GetSigner
func (ReimbursementTxSigner) Hash ¶ added in v1.1.1
func (s ReimbursementTxSigner) Hash(tx *Transaction) common.Hash
Hash excluding gasLimit and gasPrice
func (ReimbursementTxSigner) SignTx ¶ added in v1.1.1
func (s ReimbursementTxSigner) SignTx(tx *Transaction, prv *ecdsa.PrivateKey) (*Transaction, error)
SignTx returns first signature to reimbursement gas transaction
type ReplenishAsset ¶ added in v1.2.0
增发资产
type Signer ¶
type Signer interface {
// SignTx returns transaction after signature
SignTx(tx *Transaction, prv *ecdsa.PrivateKey) (*Transaction, error)
// GetSigner returns the sender address of the transaction.
GetSigner(tx *Transaction) (common.Address, error)
// Hash returns the hash to be signed.
Hash(tx *Transaction) common.Hash
}
Signer encapsulates transaction signature handling.
func MakeGasPayerSigner ¶ added in v1.1.1
func MakeGasPayerSigner() Signer
MakeGasPayerSigner returns gas payer signer
func MakeReimbursementTxSigner ¶ added in v1.1.1
func MakeReimbursementTxSigner() Signer
MakeReimbursementTxSigner returns instead of pay gas transaction signer
func MakeSigner ¶
func MakeSigner() Signer
MakeSigner returns a Signer based on the given version and chainID.
type TradingAsset ¶ added in v1.2.0
交易资产
type Transaction ¶
type Transaction struct {
// contains filtered or unexported fields
}
func GasPayerSignatureTx ¶ added in v1.1.1
func GasPayerSignatureTx(tx *Transaction, gasPrice *big.Int, gasLimit uint64) *Transaction
GasPayerSignatureTx
func NewContractCreation ¶
func NewContractCreation(amount *big.Int, gasLimit uint64, gasPrice *big.Int, data []byte, TxType uint16, chainID uint16, expiration uint64, toName string, message string) *Transaction
创建智能合约交易
func NewReimbursementContractCreation ¶ added in v1.1.1
func NewReimbursementContractCreation(gasPayer common.Address, amount *big.Int, data []byte, TxType uint16, chainID uint16, expiration uint64, toName string, message string) *Transaction
NewReimbursementContractCreation
func NewReimbursementTransaction ¶ added in v1.1.1
func NewReimbursementTransaction(to, gasPayer common.Address, amount *big.Int, data []byte, TxType uint16, chainID uint16, expiration uint64, toName string, message string) *Transaction
NewReimbursementTransaction new instead of paying gas transaction
func NewTransaction ¶
func NewTransaction(to common.Address, amount *big.Int, gasLimit uint64, gasPrice *big.Int, data []byte, TxType uint16, chainID uint16, expiration uint64, toName string, message string) *Transaction
注:TxType:0为普通交易,1为节点投票交易,2为注册成为代理节点交易
func NoReceiverTransaction ¶ added in v1.2.0
func NoReceiverTransaction(amount *big.Int, gasLimit uint64, gasPrice *big.Int, data []byte, TxType uint16, chainID uint16, expiration uint64, toName string, message string) *Transaction
实例化一个to == nil的交易
func (*Transaction) Amount ¶
func (tx *Transaction) Amount() *big.Int
func (*Transaction) ChainID ¶ added in v1.0.2
func (tx *Transaction) ChainID() uint16
func (*Transaction) Clone ¶ added in v1.2.0
func (tx *Transaction) Clone() *Transaction
Clone deep copy transaction
func (*Transaction) Cost ¶
func (tx *Transaction) Cost() *big.Int
Cost returns amount + gasprice * gaslimit.
func (*Transaction) Data ¶
func (tx *Transaction) Data() []byte
func (*Transaction) DecodeRLP ¶
func (tx *Transaction) DecodeRLP(s *rlp.Stream) error
DecodeRLP implements rlp.Decoder
func (*Transaction) EncodeRLP ¶
func (tx *Transaction) EncodeRLP(w io.Writer) error
EncodeRLP implements rlp.Encoder
func (*Transaction) Expiration ¶
func (tx *Transaction) Expiration() uint64
func (*Transaction) GasLimit ¶
func (tx *Transaction) GasLimit() uint64
func (*Transaction) GasPayer ¶ added in v1.1.1
func (tx *Transaction) GasPayer() (common.Address, error)
GetSigner returns address of instead of pay transaction gas.
func (*Transaction) GasPayerSig ¶ added in v1.1.1
func (tx *Transaction) GasPayerSig() []byte
func (*Transaction) GasPrice ¶
func (tx *Transaction) GasPrice() *big.Int
func (*Transaction) Hash ¶
func (tx *Transaction) Hash() common.Hash
func (*Transaction) MarshalJSON ¶
func (tx *Transaction) MarshalJSON() ([]byte, error)
MarshalJSON encodes the lemoClient RPC transaction format.
func (*Transaction) Message ¶
func (tx *Transaction) Message() string
func (*Transaction) Sig ¶ added in v1.2.0
func (tx *Transaction) Sig() []byte
func (*Transaction) String ¶
func (tx *Transaction) String() string
func (*Transaction) To ¶
func (tx *Transaction) To() *common.Address
func (*Transaction) ToName ¶
func (tx *Transaction) ToName() string
func (*Transaction) Type ¶
func (tx *Transaction) Type() uint16
func (*Transaction) UnmarshalJSON ¶
func (tx *Transaction) UnmarshalJSON(input []byte) error
UnmarshalJSON decodes the lemoClient RPC transaction format.
func (*Transaction) Version ¶
func (tx *Transaction) Version() uint8
type Transactions ¶
type Transactions []*Transaction
func (Transactions) MerkleRootSha ¶ added in v1.2.0
func (ts Transactions) MerkleRootSha() common.Hash
MerkleRootSha compute the root hash of transaction merkle trie
type VersionRecord ¶
type VersionRecord struct {
Version uint32 `json:"version" gencodec:"required"`
Height uint32 `json:"height" gencodec:"required"`
}
func (VersionRecord) MarshalJSON ¶
func (v VersionRecord) MarshalJSON() ([]byte, error)
MarshalJSON marshals as JSON.
func (*VersionRecord) UnmarshalJSON ¶
func (v *VersionRecord) UnmarshalJSON(input []byte) error
UnmarshalJSON unmarshals from JSON.