acm

package
v0.0.0-...-24d451d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 2, 2020 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Account

type Account struct {
	Address  crypto.BVMAddress `json:"address"` //账户地址
	PubKey   types.PubKey      `json:"pubKey"`  //账户公钥
	Balance  bn.Number         `json:"balance"`
	BVMToken goCrypto.Address  `json:"bvmToken"` // bvm 可操作的代币
	BVMCode  ByteCode          `json:"bvmCode"`
	WASMCode ByteCode          `json:"wasmCode,omitempty"`
}

Account - 账户,可以是 bvm 合约账户也可以是用户账户 作为用户账户的时候,只存取 balance(实际是balanceOfToken) ,因为已经确定了代币(BVMToken)(也可以是本币) 作为 bvm 合约账户需要存 BVMToken BVMCode/WASMCode

func Decode

func Decode(accBytes []byte) (*Account, error)

func (*Account) AddAccountTokenKey

func (a *Account) AddAccountTokenKey(transID, txID int64, keyOfAccountToken string) (err error)

func (*Account) AddToBalance

func (a *Account) AddToBalance(amount bn.Number) error

func (*Account) Copy

func (a *Account) Copy() *Account

Copies all mutable parts of account

func (*Account) Encode

func (a *Account) Encode() ([]byte, error)

func (*Account) Equal

func (a *Account) Equal(accOther *Account) bool

func (*Account) GetBalance

func (a *Account) GetBalance() bn.Number

func (*Account) SetBalance

func (a *Account) SetBalance(value bn.Number)

func (Account) String

func (a Account) String() string

func (*Account) SubtractFromBalance

func (a *Account) SubtractFromBalance(amount bn.Number) error

func (*Account) Tagged

func (a *Account) Tagged() query.Tagged

type ByteCode

type ByteCode []byte

func (ByteCode) Bytes

func (bc ByteCode) Bytes() []byte

func (ByteCode) Marshal

func (bc ByteCode) Marshal() ([]byte, error)

Protobuf support

func (ByteCode) MarshalJSON

func (bc ByteCode) MarshalJSON() ([]byte, error)

func (ByteCode) MarshalText

func (bc ByteCode) MarshalText() ([]byte, error)

func (ByteCode) MarshalTo

func (bc ByteCode) MarshalTo(data []byte) (int, error)

func (ByteCode) MustTokens

func (bc ByteCode) MustTokens() []string

func (ByteCode) Size

func (bc ByteCode) Size() int

func (ByteCode) String

func (bc ByteCode) String() string

func (ByteCode) Tokens

func (bc ByteCode) Tokens() ([]string, error)

Tokenises the bytecode into opcodes and values

func (*ByteCode) Unmarshal

func (bc *ByteCode) Unmarshal(data []byte) error

func (*ByteCode) UnmarshalJSON

func (bc *ByteCode) UnmarshalJSON(data []byte) error

func (*ByteCode) UnmarshalText

func (bc *ByteCode) UnmarshalText(text []byte) error

type TaggedAccount

type TaggedAccount struct {
	*Account
	query.Tagged
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL