acm

package
v0.22.0 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2018 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

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

Package acm is a generated protocol buffer package.

It is generated from these files:
	acm.proto

It has these top-level messages:
	ConcreteAccount

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")
)
View Source
var GlobalPermissionsAddress = crypto.Address(binary.Zero160)

Functions

This section is empty.

Types

type Account

type Account interface {
	crypto.Addressable
	// The value held by this account in terms of the chain-native token
	Balance() uint64
	// The EVM byte code held by this account (or equivalently, this contract)
	Code() Bytecode
	// The sequence number of this account, incremented each time a mutation of the
	// Account is persisted to the blockchain state
	Sequence() uint64
	// The permission flags and roles for this account
	Permissions() permission.AccountPermissions
	// Obtain a deterministic serialisation of this account
	// (i.e. update order and Go runtime independent)
	Encode() ([]byte, error)
	// String representation of the account
	String() string
	// Get tags for this account
	Tagged() query.Tagged
}

The default immutable interface to an account

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) 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 ConcreteAccount

type ConcreteAccount 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" json:"PublicKey"`
	Sequence    uint64                                       `protobuf:"varint,3,opt,name=Sequence,proto3" json:"Sequence,omitempty"`
	Balance     uint64                                       `protobuf:"varint,4,opt,name=Balance,proto3" json:"Balance,omitempty"`
	Code        Bytecode                                     `protobuf:"bytes,5,opt,name=Code,proto3,customtype=Bytecode" json:"Code"`
	Permissions permission.AccountPermissions                `protobuf:"bytes,6,opt,name=Permissions" json:"Permissions"`
}

func AsConcreteAccount

func AsConcreteAccount(account Account) *ConcreteAccount

Returns a mutable, serialisable ConcreteAccount by copying from account

func DecodeConcrete

func DecodeConcrete(accBytes []byte) (*ConcreteAccount, error)

func NewConcreteAccount

func NewConcreteAccount(pubKey crypto.PublicKey) *ConcreteAccount

func NewConcreteAccountFromSecret

func NewConcreteAccountFromSecret(secret string) *ConcreteAccount

func (ConcreteAccount) Account

func (ca ConcreteAccount) Account() Account

func (*ConcreteAccount) Descriptor

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

func (ConcreteAccount) Encode

func (ca ConcreteAccount) Encode() ([]byte, error)

func (*ConcreteAccount) GetBalance

func (m *ConcreteAccount) GetBalance() uint64

func (*ConcreteAccount) GetPermissions

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

func (*ConcreteAccount) GetPublicKey

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

func (*ConcreteAccount) GetSequence

func (m *ConcreteAccount) GetSequence() uint64

func (*ConcreteAccount) Marshal

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

func (*ConcreteAccount) MarshalTo

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

func (ConcreteAccount) MutableAccount

func (ca ConcreteAccount) MutableAccount() *MutableAccount

Wrap a copy of ConcreteAccount in a MutableAccount

func (*ConcreteAccount) ProtoMessage

func (*ConcreteAccount) ProtoMessage()

func (*ConcreteAccount) Reset

func (m *ConcreteAccount) Reset()

func (*ConcreteAccount) Size

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

func (ConcreteAccount) String

func (acc ConcreteAccount) String() string

func (*ConcreteAccount) Unmarshal

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

func (*ConcreteAccount) XXX_MessageName

func (*ConcreteAccount) XXX_MessageName() string

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 MutableAccount

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

MutableAccount structure

func AsMutableAccount

func AsMutableAccount(account Account) *MutableAccount

Returns a MutableAccount by copying from account

func Decode

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

func FromAddressable

func FromAddressable(addressable crypto.Addressable) *MutableAccount

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

func (*MutableAccount) AddToBalance

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

func (MutableAccount) Address

func (acc MutableAccount) Address() crypto.Address

/---- Getter methods

func (MutableAccount) Balance

func (acc MutableAccount) Balance() uint64

func (MutableAccount) Code

func (acc MutableAccount) Code() Bytecode

func (MutableAccount) Encode

func (acc MutableAccount) Encode() ([]byte, error)

func (*MutableAccount) IncSequence

func (acc *MutableAccount) IncSequence()

func (MutableAccount) MarshalJSON

func (acc MutableAccount) MarshalJSON() ([]byte, error)

func (*MutableAccount) MutablePermissions

func (acc *MutableAccount) MutablePermissions() *permission.AccountPermissions

func (MutableAccount) Permissions

func (acc MutableAccount) Permissions() permission.AccountPermissions

func (MutableAccount) PublicKey

func (acc MutableAccount) PublicKey() crypto.PublicKey

func (MutableAccount) Sequence

func (acc MutableAccount) Sequence() uint64

func (*MutableAccount) SetBalance

func (acc *MutableAccount) SetBalance(amount uint64) error

func (*MutableAccount) SetCode

func (acc *MutableAccount) SetCode(code []byte) error

func (*MutableAccount) SetPermissions

func (acc *MutableAccount) SetPermissions(accPerms permission.AccountPermissions) error

func (*MutableAccount) SetPublicKey

func (acc *MutableAccount) SetPublicKey(publicKey crypto.PublicKey)

/---- Mutable methods Set public key (needed for lazy initialisation), should also set the dependent address

func (MutableAccount) String

func (acc MutableAccount) String() string

func (*MutableAccount) SubtractFromBalance

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

func (*MutableAccount) Tagged

func (acc *MutableAccount) Tagged() query.Tagged

func (*MutableAccount) UnmarshalJSON

func (acc *MutableAccount) UnmarshalJSON(bytes []byte) error

type PrivateAccount

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

func GeneratePrivateAccount

func GeneratePrivateAccount() (*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 PrivateAccountFromPrivateKeyBytes

func PrivateAccountFromPrivateKeyBytes(privKeyBytes []byte) (*PrivateAccount, error)

func (*PrivateAccount) Address

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

func (*PrivateAccount) ConcretePrivateAccount

func (pa *PrivateAccount) ConcretePrivateAccount() *ConcretePrivateAccount

func (PrivateAccount) MarshalJSON

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

func (*PrivateAccount) PrivateKey

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

func (*PrivateAccount) PublicKey

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

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

type TaggedAccount

type TaggedAccount struct {
	*MutableAccount
	query.Tagged
}

Directories

Path Synopsis
Package balance is a generated protocol buffer package.
Package balance is a generated protocol buffer package.
Package validator is a generated protocol buffer package.
Package validator is a generated protocol buffer package.

Jump to

Keyboard shortcuts

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