Documentation

Overview

    The acm package contains code relating to accounts and account state the abbreviation probably derives from 'ACcount Management'

    Index

    Constants

    This section is empty.

    Variables

    View Source
    var (
    	ErrInvalidLengthAcm        = fmt.Errorf("proto: negative length found during unmarshaling")
    	ErrIntOverflowAcm          = fmt.Errorf("proto: integer overflow")
    	ErrUnexpectedEndOfGroupAcm = fmt.Errorf("proto: unexpected end of group")
    )
    View Source
    var GlobalPermissionsAddress = crypto.Address(binary.Zero160)

    Functions

    This section is empty.

    Types

    type Account

    type Account struct {
    	Address   github_com_hyperledger_burrow_crypto.Address `protobuf:"bytes,1,opt,name=Address,proto3,customtype=github.com/hyperledger/burrow/crypto.Address" json:"Address"`
    	PublicKey crypto.PublicKey                             `protobuf:"bytes,2,opt,name=PublicKey,proto3" json:"PublicKey"`
    	// Sequence counts the number of transactions that have been accepted from this account
    	Sequence uint64 `protobuf:"varint,3,opt,name=Sequence,proto3" json:"Sequence,omitempty"`
    	// The account's current native token balance
    	Balance uint64 `protobuf:"varint,4,opt,name=Balance,proto3" json:"Balance,omitempty"`
    	// We expect exactly one of EVMCode, WASMCode, and NativeName to be non-empty
    	// EVM bytecode
    	EVMCode     Bytecode                      `protobuf:"bytes,5,opt,name=EVMCode,proto3,customtype=Bytecode" json:"EVMCode"`
    	Permissions permission.AccountPermissions `protobuf:"bytes,6,opt,name=Permissions,proto3" json:"Permissions"`
    	// WASM bytecode
    	WASMCode Bytecode `protobuf:"bytes,7,opt,name=WASMCode,proto3,customtype=Bytecode" json:",omitempty"`
    	// Fully qualified (`<contract name>.<function name>`) name of native contract this for which this account object
    	// is a sentinel value. Which is to say this account object is a pointer to compiled code and does not contain
    	// the contract logic in its entirety
    	NativeName string `protobuf:"bytes,11,opt,name=NativeName,proto3" json:",omitempty"`
    	// The sha3 hash of the code associated with the account
    	CodeHash github_com_hyperledger_burrow_binary.HexBytes `protobuf:"bytes,8,opt,name=CodeHash,proto3,customtype=github.com/hyperledger/burrow/binary.HexBytes" json:"-"`
    	// Pointer to the Metadata associated with this account
    	ContractMeta []*ContractMeta `protobuf:"bytes,9,rep,name=ContractMeta,proto3" json:"ContractMeta,omitempty"`
    	// The metadata is stored in the deployed account. When the deployed account creates new account
    	// (from Solidity/EVM), they point to the original deployed account where the metadata is stored.
    	// This original account is called the forebear.
    	Forebear             *github_com_hyperledger_burrow_crypto.Address `` /* 126-byte string literal not displayed */
    	XXX_NoUnkeyedLiteral struct{}                                      `json:"-"`
    	XXX_unrecognized     []byte                                        `json:"-"`
    	XXX_sizecache        int32                                         `json:"-"`
    }

    func FromAddressable

    func FromAddressable(addressable crypto.Addressable) *Account

      Creates an otherwise zeroed Account from an Addressable and returns it as MutableAccount

      func NewAccount

      func NewAccount(pubKey crypto.PublicKey) *Account

      func NewAccountFromSecret

      func NewAccountFromSecret(secret string) *Account

      func (*Account) AddToBalance

      func (acc *Account) AddToBalance(amount uint64) error

      func (*Account) Code

      func (acc *Account) Code() []byte

        Return bytes of any code-type value that is set. EVM, WASM, or native name

        func (*Account) Copy

        func (acc *Account) Copy() *Account

          Copies all mutable parts of account

          func (*Account) Descriptor

          func (*Account) Descriptor() ([]byte, []int)

          func (*Account) Equal

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

          func (*Account) Get

          func (acc *Account) Get(key string) (interface{}, bool)

          func (*Account) GetAddress

          func (acc *Account) GetAddress() crypto.Address

          func (*Account) GetBalance

          func (m *Account) GetBalance() uint64

          func (*Account) GetContractMeta

          func (m *Account) GetContractMeta() []*ContractMeta

          func (*Account) GetNativeName

          func (m *Account) GetNativeName() string

          func (*Account) GetPermissions

          func (m *Account) GetPermissions() permission.AccountPermissions

          func (*Account) GetPublicKey

          func (m *Account) GetPublicKey() crypto.PublicKey

          func (*Account) GetSequence

          func (m *Account) GetSequence() uint64

          func (*Account) Marshal

          func (m *Account) Marshal() (dAtA []byte, err error)

          func (*Account) MarshalTo

          func (m *Account) MarshalTo(dAtA []byte) (int, error)

          func (*Account) MarshalToSizedBuffer

          func (m *Account) MarshalToSizedBuffer(dAtA []byte) (int, error)

          func (*Account) ProtoMessage

          func (*Account) ProtoMessage()

          func (*Account) Reset

          func (m *Account) Reset()

          func (*Account) Size

          func (m *Account) Size() (n int)

          func (Account) String

          func (acc Account) String() string

          func (*Account) SubtractFromBalance

          func (acc *Account) SubtractFromBalance(amount uint64) error

          func (*Account) Unmarshal

          func (m *Account) Unmarshal(dAtA []byte) error

          func (*Account) XXX_DiscardUnknown

          func (m *Account) XXX_DiscardUnknown()

          func (*Account) XXX_Marshal

          func (m *Account) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

          func (*Account) XXX_Merge

          func (m *Account) XXX_Merge(src proto.Message)

          func (*Account) XXX_MessageName

          func (*Account) XXX_MessageName() string

          func (*Account) XXX_Size

          func (m *Account) XXX_Size() int

          func (*Account) XXX_Unmarshal

          func (m *Account) XXX_Unmarshal(b []byte) error

          type AddressableSigner

          type AddressableSigner interface {
          	crypto.Addressable
          	crypto.Signer
          }

          func SigningAccounts

          func SigningAccounts(concretePrivateAccounts []*PrivateAccount) []AddressableSigner

            Convert slice of ConcretePrivateAccounts to slice of SigningAccounts

            type Bytecode

            type Bytecode []byte

            func BytecodeFromHex

            func BytecodeFromHex(hexString string) (Bytecode, error)

            func NewBytecode

            func NewBytecode(bytelikes ...interface{}) (Bytecode, error)

              Builds new bytecode using the Splice helper to map byte-like and byte-slice-like types to a flat bytecode slice

              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 ConcretePrivateAccount

                  type ConcretePrivateAccount struct {
                  	Address    crypto.Address
                  	PublicKey  crypto.PublicKey
                  	PrivateKey crypto.PrivateKey
                  }

                  func (ConcretePrivateAccount) PrivateAccount

                  func (cpa ConcretePrivateAccount) PrivateAccount() *PrivateAccount

                  func (*ConcretePrivateAccount) String

                  func (cpa *ConcretePrivateAccount) String() string

                  type ContractMeta

                  type ContractMeta struct {
                  	CodeHash     github_com_hyperledger_burrow_binary.HexBytes `protobuf:"bytes,1,opt,name=CodeHash,proto3,customtype=github.com/hyperledger/burrow/binary.HexBytes" json:"CodeHash"`
                  	MetadataHash github_com_hyperledger_burrow_binary.HexBytes `protobuf:"bytes,2,opt,name=MetadataHash,proto3,customtype=github.com/hyperledger/burrow/binary.HexBytes" json:"MetadataHash"`
                  	// In the dump format we would like the ABI rather than its hash
                  	Metadata             string   `protobuf:"bytes,3,opt,name=Metadata,proto3" json:"Metadata,omitempty"`
                  	XXX_NoUnkeyedLiteral struct{} `json:"-"`
                  	XXX_unrecognized     []byte   `json:"-"`
                  	XXX_sizecache        int32    `json:"-"`
                  }

                  func (*ContractMeta) Descriptor

                  func (*ContractMeta) Descriptor() ([]byte, []int)

                  func (*ContractMeta) GetMetadata

                  func (m *ContractMeta) GetMetadata() string

                  func (*ContractMeta) Marshal

                  func (m *ContractMeta) Marshal() (dAtA []byte, err error)

                  func (*ContractMeta) MarshalTo

                  func (m *ContractMeta) MarshalTo(dAtA []byte) (int, error)

                  func (*ContractMeta) MarshalToSizedBuffer

                  func (m *ContractMeta) MarshalToSizedBuffer(dAtA []byte) (int, error)

                  func (*ContractMeta) ProtoMessage

                  func (*ContractMeta) ProtoMessage()

                  func (*ContractMeta) Reset

                  func (m *ContractMeta) Reset()

                  func (*ContractMeta) Size

                  func (m *ContractMeta) Size() (n int)

                  func (*ContractMeta) String

                  func (m *ContractMeta) String() string

                  func (*ContractMeta) Unmarshal

                  func (m *ContractMeta) Unmarshal(dAtA []byte) error

                  func (*ContractMeta) XXX_DiscardUnknown

                  func (m *ContractMeta) XXX_DiscardUnknown()

                  func (*ContractMeta) XXX_Marshal

                  func (m *ContractMeta) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

                  func (*ContractMeta) XXX_Merge

                  func (m *ContractMeta) XXX_Merge(src proto.Message)

                  func (*ContractMeta) XXX_MessageName

                  func (*ContractMeta) XXX_MessageName() string

                  func (*ContractMeta) XXX_Size

                  func (m *ContractMeta) XXX_Size() int

                  func (*ContractMeta) XXX_Unmarshal

                  func (m *ContractMeta) XXX_Unmarshal(b []byte) error

                  type PrivateAccount

                  type PrivateAccount struct {
                  	// contains filtered or unexported fields
                  }

                  func GenerateEthereumAccountFromSecret

                  func GenerateEthereumAccountFromSecret(secret string) *PrivateAccount

                  func GeneratePrivateAccount

                  func GeneratePrivateAccount(ct crypto.CurveType) (*PrivateAccount, error)

                    Generates a new account with private key.

                    func GeneratePrivateAccountFromSecret

                    func GeneratePrivateAccountFromSecret(secret string) *PrivateAccount

                      Generates a new account with private key from SHA256 hash of a secret

                      func PrivateAccountFromPrivateKey

                      func PrivateAccountFromPrivateKey(privateKey crypto.PrivateKey) *PrivateAccount

                      func (*PrivateAccount) ConcretePrivateAccount

                      func (pa *PrivateAccount) ConcretePrivateAccount() *ConcretePrivateAccount

                      func (*PrivateAccount) GetAddress

                      func (pa *PrivateAccount) GetAddress() crypto.Address

                      func (*PrivateAccount) GetPublicKey

                      func (pa *PrivateAccount) GetPublicKey() crypto.PublicKey

                      func (PrivateAccount) MarshalJSON

                      func (pa PrivateAccount) MarshalJSON() ([]byte, error)

                      func (*PrivateAccount) PrivateKey

                      func (pa *PrivateAccount) PrivateKey() crypto.PrivateKey

                      func (*PrivateAccount) Sign

                      func (pa *PrivateAccount) Sign(msg []byte) (*crypto.Signature, error)

                      func (*PrivateAccount) String

                      func (pa *PrivateAccount) String() string

                      func (*PrivateAccount) UnmarshalJSON

                      func (pa *PrivateAccount) UnmarshalJSON(bytes []byte) error

                      Directories

                      Path Synopsis