Documentation ¶
Index ¶
Constants ¶
View Source
const ( AccountAddressLength = 32 ContractAddressLength = 64 )
View Source
const ( EKTAddress = "" GasAddress = "0000000000000000000000000000000000000000000000000000000000000001" )
View Source
const ( EKT_DECIMAL = 8 GAS_DECIMAL = 0 )
Variables ¶
This section is empty.
Functions ¶
func FromPubKeyToAddress ¶
Types ¶
type Account ¶
type Account struct { Address HexBytes `json:"address"` Amount int64 `json:"amount"` Gas int64 `json:"gas"` Nonce int64 `json:"nonce"` Contracts map[string]ContractAccount `json:"contracts"` Balances map[string]int64 `json:"balances"` }
func NewAccount ¶
func (*Account) Transfer ¶
func (account *Account) Transfer(change AccountChange) bool
type AccountChange ¶
func NewAccountChange ¶
func NewAccountChange() *AccountChange
func (*AccountChange) Add ¶
func (change *AccountChange) Add(tokenAddress string, amount int64)
func (*AccountChange) Reduce ¶
func (change *AccountChange) Reduce(tokenAddress string, amount int64)
type ContractAccount ¶
type ContractAccount struct { Address HexBytes `json:"address"` Amount int64 `json:"amount"` Gas int64 `json:"gas"` CodeHash HexBytes `json:"codeHash"` ContractData ContractData `json:"data"` Balances map[string]int64 `json:"balances"` }
func NewContractAccount ¶
func NewContractAccount(address []byte, contractHash []byte, contractData ContractData) *ContractAccount
func (*ContractAccount) Transfer ¶
func (account *ContractAccount) Transfer(change AccountChange) bool
type ContractData ¶
type ContractData struct { Prop ContractProp `json:"prop"` Contract string `json:"contract"` }
func (ContractData) Bytes ¶
func (contractData ContractData) Bytes() []byte
func (*ContractData) MarshalJSON ¶
func (contractData *ContractData) MarshalJSON() ([]byte, error)
type ContractProp ¶
type ContractProp struct { Name string `json:"name"` Author string `json:"author"` Upgradable bool `json:"upgradable"` }
Contract address contains 64 bytes The first 32 byte represents the founders of contract, it is create by system if the first The end 32 byte represents the true address of contract for a founder
func (*ContractProp) MarshalJSON ¶
func (contractProp *ContractProp) MarshalJSON() ([]byte, error)
type Peer ¶
Click to show internal directories.
Click to hide internal directories.