Documentation ¶
Index ¶
- Constants
- Variables
- func BloomLookup(bin Bloom, topic bytesBacked) bool
- func ContractParameterTypeToByte(c []ContractParameterType) []byte
- func IsMultiSigContract(script []byte) bool
- func IsSignatureCotract(script []byte) bool
- func LogsBloom(logs []*Nep5Log) *big.Int
- type Bloom
- type Contract
- type ContractParameterType
- type FunctionCode
- func (fc *FunctionCode) CodeHash() common.Uint168
- func (fc *FunctionCode) Deserialize(r io.Reader) error
- func (fc *FunctionCode) GetCode() []byte
- func (fc *FunctionCode) GetParameterTypes() []ContractParameterType
- func (fc *FunctionCode) GetReturnType() ContractParameterType
- func (fc *FunctionCode) Serialize(w io.Writer) error
- type Header
- func (header *Header) Deserialize(r io.Reader) error
- func (header *Header) GetAuxPow() *auxpow.SideAuxPow
- func (header *Header) GetBits() uint32
- func (header *Header) GetHeight() uint32
- func (header *Header) GetMerkleRoot() common.Uint256
- func (header *Header) GetNonce() uint32
- func (header *Header) GetPrevious() common.Uint256
- func (header *Header) GetTimeStamp() uint32
- func (header *Header) GetVersion() uint32
- func (header *Header) Hash() common.Uint256
- func (header *Header) Serialize(w io.Writer) error
- func (header *Header) SetAuxPow(sideAuxPow *auxpow.SideAuxPow)
- func (header *Header) SetBits(bits uint32)
- func (header *Header) SetHeight(height uint32)
- func (header *Header) SetMerkleRoot(root common.Uint256)
- func (header *Header) SetNonce(nonce uint32)
- func (header *Header) SetPrevious(previous common.Uint256)
- func (header *Header) SetTimeStamp(timestamp uint32)
- func (header *Header) SetVersion(version uint32)
- type Nep5Log
- type PayloadDeploy
- type PayloadInvoke
- type Receipt
- type Receipts
Constants ¶
View Source
const ( // BloomByteLength represents the number of bytes used in a header log bloom. BloomByteLength = 256 // BloomBitLength represents the number of bits used in a header log bloom. BloomBitLength = 8 * BloomByteLength )
Variables ¶
View Source
var Bloom9 = bloom9
View Source
var ParameterTypeMap = map[string]ContractParameterType{ "Signature": Signature, "Boolean": Boolean, "Integer": Integer, "Hash160": Hash160, "Hash256": Hash256, "ByteArray": ByteArray, "PublicKey": PublicKey, "String": String, "Object": Object, "Hash168": Hash168, "Array": Array, "Void": Void, }
Functions ¶
func BloomLookup ¶
func ContractParameterTypeToByte ¶
func ContractParameterTypeToByte(c []ContractParameterType) []byte
func IsMultiSigContract ¶
func IsSignatureCotract ¶
Types ¶
type Bloom ¶
type Bloom [BloomByteLength]byte
Bloom represents a 2048 bit bloom filter.
func BytesToBloom ¶
BytesToBloom converts a byte slice to a bloom filter. It panics if b is not of suitable size.
func CreateBloom ¶
type Contract ¶
type Contract struct { //the contract program code,which will be run on VM or specific envrionment Code []byte //the Contract Parameter type list // describe the number of contract program parameters and the parameter type Parameters []ContractParameterType //The program hash as contract address ProgramHash common.Uint168 //owner's pubkey hash indicate the owner of contract OwnerPubkeyHash common.Uint168 }
Contract include the program codes with parameters which can be executed on specific evnrioment
type ContractParameterType ¶
type ContractParameterType byte
parameter defined type.
const ( Signature ContractParameterType = iota Boolean Integer Hash160 Hash256 ByteArray PublicKey String Object Hash168 Array = 0x10 Void = 0xff )
func ByteToContractParameterType ¶
func ByteToContractParameterType(b []byte) []ContractParameterType
type FunctionCode ¶
type FunctionCode struct { // Contract Code Code []byte // Contract parameter type list ParameterTypes []ContractParameterType // Contract return type list ReturnType ContractParameterType // contains filtered or unexported fields }
func (*FunctionCode) CodeHash ¶
func (fc *FunctionCode) CodeHash() common.Uint168
Get the hash of the smart contract
func (*FunctionCode) Deserialize ¶
func (fc *FunctionCode) Deserialize(r io.Reader) error
method of SerializableData
func (*FunctionCode) GetParameterTypes ¶
func (fc *FunctionCode) GetParameterTypes() []ContractParameterType
Get the list of parameter value
func (*FunctionCode) GetReturnType ¶
func (fc *FunctionCode) GetReturnType() ContractParameterType
Get the list of return value
type Header ¶
func (*Header) GetAuxPow ¶
func (header *Header) GetAuxPow() *auxpow.SideAuxPow
func (*Header) GetMerkleRoot ¶
func (*Header) GetPrevious ¶
func (*Header) GetTimeStamp ¶
func (*Header) GetVersion ¶
func (*Header) SetAuxPow ¶
func (header *Header) SetAuxPow(sideAuxPow *auxpow.SideAuxPow)
func (*Header) SetMerkleRoot ¶
func (*Header) SetPrevious ¶
func (*Header) SetTimeStamp ¶
func (*Header) SetVersion ¶
type Nep5Log ¶
type Nep5Log struct { // Consensus fields: // address of the contract that generated the event Address string // nep5 address on transfer about from and to From common.Uint160 To common.Uint160 Data big.Int // Derived fields. These fields are filled in by the node // but not secured by consensus. // block in which the transaction was included BlockNumber uint32 `json:"blockNumber"` // hash of the transaction TxHash string `json:"transactionHash" gencodec:"required"` // index of the transaction in the block TxIndex uint32 `json:"transactionIndex" gencodec:"required"` // hash of the block in which the transaction was included BlockHash string `json:"blockHash"` // index of the log in the block Index uint32 `json:"logIndex" gencodec:"required"` }
Nep5Log represents a contract log event. These events are generated by the nep5 transfer event by the node.
type PayloadDeploy ¶
type PayloadDeploy struct { Code *FunctionCode Name string CodeVersion string Author string Email string Description string ProgramHash common.Uint168 Gas common.Fixed64 }
func (*PayloadDeploy) Data ¶
func (dc *PayloadDeploy) Data(version byte) []byte
func (*PayloadDeploy) Deserialize ¶
func (dc *PayloadDeploy) Deserialize(r io.Reader, version byte) error
type PayloadInvoke ¶
type PayloadInvoke struct { CodeHash common.Uint168 Code []byte ProgramHash common.Uint168 Gas common.Fixed64 }
func (*PayloadInvoke) Data ¶
func (ic *PayloadInvoke) Data(version byte) []byte
func (*PayloadInvoke) Deserialize ¶
func (ic *PayloadInvoke) Deserialize(r io.Reader, version byte) error
type Receipt ¶
type Receipt struct { // Consensus fields: These fields are defined by the Yellow Paper Status bool `json:"status"` Logs []*Nep5Log `json:"logs" gencodec:"required"` // Implementation fields: These fields are added by geth when processing a transaction. // They are stored in the chain database. TxHash common.Uint256 `json:"transactionHash" gencodec:"required"` ContractAddress common.Uint168 `json:"contractAddress"` GasUsed uint64 `json:"gasUsed" gencodec:"required"` // Inclusion information: These fields provide information about the inclusion of the // transaction corresponding to this receipt. BlockHash common.Uint256 `json:"blockHash,omitempty"` BlockNumber uint32 `json:"blockNumber,omitempty"` TransactionIndex uint32 `json:"transactionIndex"` }
Receipt represents the results of a transaction.
func NewReceipt ¶
func NewReceipt(contractAddr common.Uint168, tx *types.Transaction, block *types.Block) (*Receipt, error)
NewReceipt creates a barebone transaction receipt, copying the init fields.
func (*Receipt) GetTxIndex ¶
Click to show internal directories.
Click to hide internal directories.