acm

package
v0.25.0 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2019 License: Apache-2.0 Imports: 17 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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")
)
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             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,proto3" json:"Permissions"`
	XXX_NoUnkeyedLiteral struct{}                                     `json:"-"`
	XXX_unrecognized     []byte                                       `json:"-"`
	XXX_sizecache        int32                                        `json:"-"`
}

func Decode

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

func FromAddressable

func FromAddressable(addressable crypto.Addressable) *Account

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

func NewAccount added in v0.23.0

func NewAccount(pubKey crypto.PublicKey) *Account

func NewAccountFromSecret added in v0.23.0

func NewAccountFromSecret(secret string) *Account

func (*Account) AddToBalance added in v0.25.0

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

func (*Account) Copy added in v0.23.0

func (acc *Account) Copy() *Account

Copies all mutable parts of account

func (*Account) Descriptor added in v0.23.0

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

func (*Account) Encode

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

func (*Account) Equal added in v0.23.0

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

func (*Account) GetAddress added in v0.23.0

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

func (*Account) GetBalance added in v0.23.0

func (m *Account) GetBalance() uint64

func (*Account) GetPermissions added in v0.23.0

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

func (*Account) GetPublicKey added in v0.23.0

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

func (*Account) GetSequence added in v0.23.0

func (m *Account) GetSequence() uint64

func (*Account) Marshal added in v0.23.0

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

func (*Account) MarshalTo added in v0.23.0

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

func (*Account) ProtoMessage added in v0.23.0

func (*Account) ProtoMessage()

func (*Account) Reset added in v0.23.0

func (m *Account) Reset()

func (*Account) Size added in v0.23.0

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

func (Account) String

func (acc Account) String() string

func (*Account) SubtractFromBalance added in v0.25.0

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

func (*Account) Tagged

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

func (*Account) Unmarshal added in v0.23.0

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

func (*Account) XXX_DiscardUnknown added in v0.23.0

func (m *Account) XXX_DiscardUnknown()

func (*Account) XXX_Marshal added in v0.23.0

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

func (*Account) XXX_Merge added in v0.23.0

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

func (*Account) XXX_MessageName added in v0.23.0

func (*Account) XXX_MessageName() string

func (*Account) XXX_Size added in v0.23.0

func (m *Account) XXX_Size() int

func (*Account) XXX_Unmarshal added in v0.23.0

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 added in v0.23.0

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

func (pa *PrivateAccount) ConcretePrivateAccount() *ConcretePrivateAccount

func (*PrivateAccount) GetAddress added in v0.23.0

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

func (*PrivateAccount) GetPublicKey added in v0.23.0

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

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