imesh

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2019 License: MIT Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidLengthImesh = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowImesh   = fmt.Errorf("proto: integer overflow")
)
View Source
var Genesis *tx.Transaction

Genesis is the genesis tx.

View Source
var (
	StatusGenesis uint32 = 1
)

Status is a status for tx.

Functions

func CheckAddNoexist

func CheckAddNoexist(s *setting.Setting, h ...tx.Hash) ([]tx.Hash, error)

CheckAddNoexist puts h to noexist db if not exist in imesh db and unresolved db. This func returns true if h alreaady exist in db.

func Confirm

func Confirm(s *setting.Setting, hs ...tx.Hash) ([]tx.Hash, error)

Confirm txs from h.

func ExistInUnresolved

func ExistInUnresolved(s *setting.Setting, h tx.Hash) (bool, error)

ExistInUnresolved returns true if h is now in unresolved db.

func GetDistribution

func GetDistribution(s *setting.Setting) ([]int64, error)

GetDistribution get the ADK distribution.

func GetFollowingHashes

func GetFollowingHashes(s *setting.Setting, ls []tx.Hash) ([]tx.Hash, error)

GetFollowingHashes returns hashes whose number are following ones of ls.

func GetHisoty

func GetHisoty(s *aklib.DBConfig, adrstr string, utxoOnly bool) ([]*tx.InoutHash, error)

GetHisoty returns utxo (or all outputs) and input hashes associated with address adr.

func GetLatestTxs

func GetLatestTxs(s *setting.Setting) ([]tx.Hash, error)

GetLatestTxs returns 5 latest transactions received.

func GetMinableTx

func GetMinableTx(s *setting.Setting, h tx.Hash, typ tx.Type) (*tx.Transaction, error)

GetMinableTx gets a minable transaction into db.

func GetMultisig

func GetMultisig(bdb *bolt.DB, madr []byte) (*tx.MultisigStruct, error)

GetMultisig returns a Multisig structure whose address is madr.

func GetNoexist

func GetNoexist(s *setting.Setting) ([]tx.Hash, error)

GetNoexist get noexist txs. #txs won't be more than 1000.

func GetOTATxs

func GetOTATxs(bdb *bolt.DB, skip, max int) ([]tx.Hash, error)

GetOTATxs returns latest max number of OTA txs , skipped skip txs..

func GetOutput

func GetOutput(s *aklib.DBConfig, ih *tx.InoutHash) (*tx.Output, error)

GetOutput returns an output related to InOutHash ih. If ih is output, returns the output specified by ih. If ih is input, return output referred by the input.

func GetPendings

func GetPendings(s *setting.Setting) ([]tx.Hash, error)

GetPendings gets all pending txs.

func GetRandomFeeTx

func GetRandomFeeTx(s *setting.Setting, min uint64) (*tx.Transaction, error)

GetRandomFeeTx gets a fee minable transaction from db.

func GetRandomTicketTx

func GetRandomTicketTx(s *setting.Setting) (*tx.Transaction, error)

GetRandomTicketTx gets a ticket minable transaction from db.

func GetRejected

func GetRejected(s *setting.Setting) ([]tx.Hash, error)

GetRejected gets all rejected txs.

func GetTx

func GetTx(akdb *bolt.DB, hash []byte) (*tx.Transaction, error)

GetTx returns a transaction from hash.

func GetTxNo

func GetTxNo(s *setting.Setting) uint64

GetTxNo returns a total number of txs in imesh.

func GetUnresolvedTxs

func GetUnresolvedTxs(s *setting.Setting) ([]tx.Hash, error)

GetUnresolvedTxs returns unresolved txs

func GetUnresolvedTxsNum

func GetUnresolvedTxsNum(s *setting.Setting) (int, error)

GetUnresolvedTxsNum returns the number of unresolved txs

func Has

func Has(bdb *bolt.DB, hash []byte) (bool, error)

Has returns true if hash exists in db.

func HasTxn

func HasTxn(txn *bolt.Bucket, hash []byte) bool

HasTxn returns true if hash exists in db.

func Init

func Init(ctx context.Context, s *setting.Setting) error

Init initialize imesh db and unresolved txs.

func Init4AKWallet

func Init4AKWallet(s *aklib.DBConfig) error

Init4AKWallet initialize imesh db and unresolved txs.

func IsMinableTxValid

func IsMinableTxValid(s *setting.Setting, tr *tx.Transaction) (bool, error)

IsMinableTxValid returns true if all inputs are not used in imesh.

func IsValid

func IsValid(s *setting.Setting, tr *tx.Transaction, typ tx.Type) error

IsValid checks transaction tr is valid for a mamber of iMesh.

func PostConfirm

func PostConfirm(s *setting.Setting, reject bool, hs ...tx.Hash) error

PostConfirm remove lock flags from all inputs of h if needed.

func PreviousMultisigOutput

func PreviousMultisigOutput(s *setting.Setting, in *tx.MultiSigIn) (*tx.MultiSigOut, error)

PreviousMultisigOutput returns an output of the multisig input tx.

func PreviousOutput

func PreviousOutput(s *setting.Setting, in *tx.Input) (*tx.Output, error)

PreviousOutput returns an output of the input tx.

func PutAddressToTx

func PutAddressToTx(txn *bolt.Bucket, tr *TxInfo) error

PutAddressToTx stores related addresses with tr. should be called synchonously

func PutMinableTxn

func PutMinableTxn(s *setting.Setting, txn *bolt.Bucket, tr *tx.Transaction, typ tx.Type) error

PutMinableTxn puts a minable tx.

func PutRawTxDirect

func PutRawTxDirect(s *aklib.DBConfig, trs ...*tx.Transaction) error

PutRawTxDirect puts a transaction into db without checking tx relation.. It should be used only from wallet

func PutTx

func PutTx(s *setting.Setting, tr *tx.Transaction) error

PutTx puts a transaction into db. test only

func PutTxInfoTxn

func PutTxInfoTxn(txn *bolt.Bucket, ti *TxInfo) error

PutTxInfoTxn puts an TxInfo

func SetSpent

func SetSpent(txn *bolt.Bucket, h tx.Hash, isAccepted bool) error

SetSpent sets spent flag for all inputs of h. Should be used from akwallet only.

func SetUsedByMinable

func SetUsedByMinable(bdb *bolt.DB, tr *tx.Transaction, typ tx.Type) error

SetUsedByMinable sets used by minable for all inputs of tr. should be only used by akwallet.

func SortByDate

func SortByDate(bdb *bolt.DB, inout []*tx.InoutHash, ascend bool) error

SortByDate sorts tx.InoutHash slice by date.

Types

type Balance

type Balance struct {
	Bal int64 `protobuf:"varint,1,opt,name=bal,proto3" json:"bal,omitempty"`
}

func NewPopulatedBalance

func NewPopulatedBalance(r randyImesh, easy bool) *Balance

func (*Balance) Descriptor

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

func (*Balance) Equal

func (this *Balance) Equal(that interface{}) bool

func (*Balance) Marshal

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

func (*Balance) MarshalTo

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

func (*Balance) ProtoMessage

func (*Balance) ProtoMessage()

func (*Balance) Reset

func (m *Balance) Reset()

func (*Balance) Size

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

func (*Balance) String

func (m *Balance) String() string

func (*Balance) Unmarshal

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

func (*Balance) XXX_DiscardUnknown

func (m *Balance) XXX_DiscardUnknown()

func (*Balance) XXX_Marshal

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

func (*Balance) XXX_Merge

func (dst *Balance) XXX_Merge(src proto.Message)

func (*Balance) XXX_Size

func (m *Balance) XXX_Size() int

func (*Balance) XXX_Unmarshal

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

type Body

type Body struct {
	Nonce        []uint32                                  `protobuf:"varint,1,rep,packed,name=nonce,proto3" json:"nonce,omitempty"`
	Gnonce       uint32                                    `protobuf:"varint,2,opt,name=gnonce,proto3" json:"gnonce,omitempty"`
	Time         time.Time                                 `protobuf:"bytes,3,opt,name=time,proto3,stdtime" json:"time"`
	Message      github_com_AidosKuneen_aklib_tx.ByteSlice `protobuf:"bytes,4,opt,name=message,proto3,casttype=github.com/AidosKuneen/aklib/tx.ByteSlice" json:"message,omitempty"`
	ExchangeKey  []byte                                    `protobuf:"bytes,5,opt,name=exchange_key,json=exchangeKey,proto3" json:"exchange_key,omitempty"`
	Inputs       []*Input                                  `protobuf:"bytes,6,rep,name=inputs,proto3" json:"inputs,omitempty"`
	MultiSigIns  []*MultiSigIn                             `protobuf:"bytes,7,rep,name=multi_sig_ins,json=multiSigIns,proto3" json:"multi_sig_ins,omitempty"`
	Outputs      []*Output                                 `protobuf:"bytes,8,rep,name=outputs,proto3" json:"outputs,omitempty"`
	MultiSigOuts []*MultiSigOut                            `protobuf:"bytes,9,rep,name=multi_sig_outs,json=multiSigOuts,proto3" json:"multi_sig_outs,omitempty"`
	Parent       []uint64                                  `protobuf:"varint,10,rep,packed,name=parent,proto3" json:"parent,omitempty"`
	Easiness     uint32                                    `protobuf:"varint,11,opt,name=easiness,proto3" json:"easiness,omitempty"`
	LockTime     time.Time                                 `protobuf:"bytes,12,opt,name=lock_time,json=lockTime,proto3,stdtime" json:"lock_time"`
	HashType     uint16                                    `protobuf:"varint,13,opt,name=hash_type,json=hashType,proto3,casttype=uint16" json:"hash_type,omitempty"`
	TicketInput  uint64                                    `protobuf:"varint,14,opt,name=ticket_input,json=ticketInput,proto3" json:"ticket_input,omitempty"`
	TicketOutput uint64                                    `protobuf:"varint,15,opt,name=ticket_output,json=ticketOutput,proto3" json:"ticket_output,omitempty"`
}

Body is a Transactoin except signature.

func NewPopulatedBody

func NewPopulatedBody(r randyImesh, easy bool) *Body

func (*Body) Descriptor

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

func (*Body) Equal

func (this *Body) Equal(that interface{}) bool

func (*Body) Marshal

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

func (*Body) MarshalTo

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

func (*Body) ProtoMessage

func (*Body) ProtoMessage()

func (*Body) Reset

func (m *Body) Reset()

func (*Body) Size

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

func (*Body) String

func (m *Body) String() string

func (*Body) Unmarshal

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

func (*Body) XXX_DiscardUnknown

func (m *Body) XXX_DiscardUnknown()

func (*Body) XXX_Marshal

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

func (*Body) XXX_Merge

func (dst *Body) XXX_Merge(src proto.Message)

func (*Body) XXX_Size

func (m *Body) XXX_Size() int

func (*Body) XXX_Unmarshal

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

type Distribution

type Distribution struct {
	Dist []int64 `protobuf:"varint,1,rep,packed,name=dist,proto3" json:"dist,omitempty"`
}

Distribution is the distribution of ADK holders.

func NewPopulatedDistribution

func NewPopulatedDistribution(r randyImesh, easy bool) *Distribution

func (*Distribution) Descriptor

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

func (*Distribution) Equal

func (this *Distribution) Equal(that interface{}) bool

func (*Distribution) Marshal

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

func (*Distribution) MarshalTo

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

func (*Distribution) ProtoMessage

func (*Distribution) ProtoMessage()

func (*Distribution) Reset

func (m *Distribution) Reset()

func (*Distribution) Size

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

func (*Distribution) String

func (m *Distribution) String() string

func (*Distribution) Unmarshal

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

func (*Distribution) XXX_DiscardUnknown

func (m *Distribution) XXX_DiscardUnknown()

func (*Distribution) XXX_Marshal

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

func (*Distribution) XXX_Merge

func (dst *Distribution) XXX_Merge(src proto.Message)

func (*Distribution) XXX_Size

func (m *Distribution) XXX_Size() int

func (*Distribution) XXX_Unmarshal

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

type InoutHash

type InoutHash struct {
	Tx    uint64                                        `protobuf:"varint,1,opt,name=tx,proto3" json:"tx,omitempty"`
	Type  github_com_AidosKuneen_aklib_tx.InOutHashType `protobuf:"varint,2,opt,name=type,proto3,casttype=github.com/AidosKuneen/aklib/tx.InOutHashType" json:"type,omitempty"`
	Index byte                                          `protobuf:"varint,3,opt,name=index,proto3,casttype=byte" json:"index,omitempty"`
}

func NewPopulatedInoutHash

func NewPopulatedInoutHash(r randyImesh, easy bool) *InoutHash

func (*InoutHash) Descriptor

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

func (*InoutHash) Equal

func (this *InoutHash) Equal(that interface{}) bool

func (*InoutHash) Marshal

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

func (*InoutHash) MarshalTo

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

func (*InoutHash) ProtoMessage

func (*InoutHash) ProtoMessage()

func (*InoutHash) Reset

func (m *InoutHash) Reset()

func (*InoutHash) Size

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

func (*InoutHash) String

func (m *InoutHash) String() string

func (*InoutHash) Unmarshal

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

func (*InoutHash) XXX_DiscardUnknown

func (m *InoutHash) XXX_DiscardUnknown()

func (*InoutHash) XXX_Marshal

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

func (*InoutHash) XXX_Merge

func (dst *InoutHash) XXX_Merge(src proto.Message)

func (*InoutHash) XXX_Size

func (m *InoutHash) XXX_Size() int

func (*InoutHash) XXX_Unmarshal

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

type Input

type Input struct {
	PreviousTX uint64 `protobuf:"varint,1,opt,name=previous_tx,json=previousTx,proto3" json:"previous_tx,omitempty"`
	Index      byte   `protobuf:"varint,2,opt,name=index,proto3,casttype=byte" json:"index,omitempty"`
}

Input is an input in transactions.

func NewPopulatedInput

func NewPopulatedInput(r randyImesh, easy bool) *Input

func (*Input) Descriptor

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

func (*Input) Equal

func (this *Input) Equal(that interface{}) bool

func (*Input) Marshal

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

func (*Input) MarshalTo

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

func (*Input) ProtoMessage

func (*Input) ProtoMessage()

func (*Input) Reset

func (m *Input) Reset()

func (*Input) Size

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

func (*Input) String

func (m *Input) String() string

func (*Input) Unmarshal

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

func (*Input) XXX_DiscardUnknown

func (m *Input) XXX_DiscardUnknown()

func (*Input) XXX_Marshal

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

func (*Input) XXX_Merge

func (dst *Input) XXX_Merge(src proto.Message)

func (*Input) XXX_Size

func (m *Input) XXX_Size() int

func (*Input) XXX_Unmarshal

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

type LatestTxs

type LatestTxs struct {
	Txs []github_com_AidosKuneen_aklib_tx.Hash `protobuf:"bytes,1,rep,name=txs,proto3,casttype=github.com/AidosKuneen/aklib/tx.Hash" json:"txs,omitempty"`
}

func NewPopulatedLatestTxs

func NewPopulatedLatestTxs(r randyImesh, easy bool) *LatestTxs

func (*LatestTxs) Descriptor

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

func (*LatestTxs) Equal

func (this *LatestTxs) Equal(that interface{}) bool

func (*LatestTxs) Marshal

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

func (*LatestTxs) MarshalTo

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

func (*LatestTxs) ProtoMessage

func (*LatestTxs) ProtoMessage()

func (*LatestTxs) Reset

func (m *LatestTxs) Reset()

func (*LatestTxs) Size

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

func (*LatestTxs) String

func (m *LatestTxs) String() string

func (*LatestTxs) Unmarshal

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

func (*LatestTxs) XXX_DiscardUnknown

func (m *LatestTxs) XXX_DiscardUnknown()

func (*LatestTxs) XXX_Marshal

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

func (*LatestTxs) XXX_Merge

func (dst *LatestTxs) XXX_Merge(src proto.Message)

func (*LatestTxs) XXX_Size

func (m *LatestTxs) XXX_Size() int

func (*LatestTxs) XXX_Unmarshal

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

type MultiSigIn

type MultiSigIn struct {
	PreviousTX uint64 `protobuf:"varint,1,opt,name=previous_tx,json=previousTx,proto3" json:"previous_tx,omitempty"`
	Index      byte   `protobuf:"varint,2,opt,name=index,proto3,casttype=byte" json:"index,omitempty"`
}

MultiSigIn is an multisig input in transactions.

func NewPopulatedMultiSigIn

func NewPopulatedMultiSigIn(r randyImesh, easy bool) *MultiSigIn

func (*MultiSigIn) Descriptor

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

func (*MultiSigIn) Equal

func (this *MultiSigIn) Equal(that interface{}) bool

func (*MultiSigIn) Marshal

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

func (*MultiSigIn) MarshalTo

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

func (*MultiSigIn) ProtoMessage

func (*MultiSigIn) ProtoMessage()

func (*MultiSigIn) Reset

func (m *MultiSigIn) Reset()

func (*MultiSigIn) Size

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

func (*MultiSigIn) String

func (m *MultiSigIn) String() string

func (*MultiSigIn) Unmarshal

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

func (*MultiSigIn) XXX_DiscardUnknown

func (m *MultiSigIn) XXX_DiscardUnknown()

func (*MultiSigIn) XXX_Marshal

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

func (*MultiSigIn) XXX_Merge

func (dst *MultiSigIn) XXX_Merge(src proto.Message)

func (*MultiSigIn) XXX_Size

func (m *MultiSigIn) XXX_Size() int

func (*MultiSigIn) XXX_Unmarshal

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

type MultiSigOut

type MultiSigOut struct {
	MultisigStruct `protobuf:"bytes,1,opt,name=multisig_struct,json=multisigStruct,proto3,embedded=multisig_struct" json:"multisig_struct"`
	Value          uint64 `protobuf:"varint,3,opt,name=value,proto3" json:"value,omitempty"`
}

MultiSigOut is an multisig output in transactions.

func NewPopulatedMultiSigOut

func NewPopulatedMultiSigOut(r randyImesh, easy bool) *MultiSigOut

func (*MultiSigOut) Descriptor

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

func (*MultiSigOut) Equal

func (this *MultiSigOut) Equal(that interface{}) bool

func (*MultiSigOut) Marshal

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

func (*MultiSigOut) MarshalTo

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

func (*MultiSigOut) ProtoMessage

func (*MultiSigOut) ProtoMessage()

func (*MultiSigOut) Reset

func (m *MultiSigOut) Reset()

func (*MultiSigOut) Size

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

func (*MultiSigOut) String

func (m *MultiSigOut) String() string

func (*MultiSigOut) Unmarshal

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

func (*MultiSigOut) XXX_DiscardUnknown

func (m *MultiSigOut) XXX_DiscardUnknown()

func (*MultiSigOut) XXX_Marshal

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

func (*MultiSigOut) XXX_Merge

func (dst *MultiSigOut) XXX_Merge(src proto.Message)

func (*MultiSigOut) XXX_Size

func (m *MultiSigOut) XXX_Size() int

func (*MultiSigOut) XXX_Unmarshal

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

type MultisigStruct

type MultisigStruct struct {
	M         byte     `protobuf:"varint,1,opt,name=m,proto3,casttype=byte" json:"m,omitempty"`
	Addresses []uint64 `protobuf:"varint,2,rep,packed,name=addresses,proto3" json:"addresses,omitempty"`
}

MultisigStruct is a structure of multisig.

func NewPopulatedMultisigStruct

func NewPopulatedMultisigStruct(r randyImesh, easy bool) *MultisigStruct

func (*MultisigStruct) Descriptor

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

func (*MultisigStruct) Equal

func (this *MultisigStruct) Equal(that interface{}) bool

func (*MultisigStruct) Marshal

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

func (*MultisigStruct) MarshalTo

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

func (*MultisigStruct) ProtoMessage

func (*MultisigStruct) ProtoMessage()

func (*MultisigStruct) Reset

func (m *MultisigStruct) Reset()

func (*MultisigStruct) Size

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

func (*MultisigStruct) String

func (m *MultisigStruct) String() string

func (*MultisigStruct) Unmarshal

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

func (*MultisigStruct) XXX_DiscardUnknown

func (m *MultisigStruct) XXX_DiscardUnknown()

func (*MultisigStruct) XXX_Marshal

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

func (*MultisigStruct) XXX_Merge

func (dst *MultisigStruct) XXX_Merge(src proto.Message)

func (*MultisigStruct) XXX_Size

func (m *MultisigStruct) XXX_Size() int

func (*MultisigStruct) XXX_Unmarshal

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

type Output

type Output struct {
	Address uint64 `protobuf:"varint,1,opt,name=address,proto3" json:"address,omitempty"`
	Value   uint64 `protobuf:"varint,2,opt,name=value,proto3" json:"value,omitempty"`
}

Output is an output in transactions.

func NewPopulatedOutput

func NewPopulatedOutput(r randyImesh, easy bool) *Output

func (*Output) Descriptor

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

func (*Output) Equal

func (this *Output) Equal(that interface{}) bool

func (*Output) Marshal

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

func (*Output) MarshalTo

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

func (*Output) ProtoMessage

func (*Output) ProtoMessage()

func (*Output) Reset

func (m *Output) Reset()

func (*Output) Size

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

func (*Output) String

func (m *Output) String() string

func (*Output) Unmarshal

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

func (*Output) XXX_DiscardUnknown

func (m *Output) XXX_DiscardUnknown()

func (*Output) XXX_Marshal

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

func (*Output) XXX_Merge

func (dst *Output) XXX_Merge(src proto.Message)

func (*Output) XXX_Size

func (m *Output) XXX_Size() int

func (*Output) XXX_Unmarshal

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

type OutputStats

type OutputStats struct {
	Stat []OutputStatus `protobuf:"bytes,1,rep,name=stat,proto3" json:"stat"`
}

func NewPopulatedOutputStats

func NewPopulatedOutputStats(r randyImesh, easy bool) *OutputStats

func (*OutputStats) Descriptor

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

func (*OutputStats) Equal

func (this *OutputStats) Equal(that interface{}) bool

func (*OutputStats) Marshal

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

func (*OutputStats) MarshalTo

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

func (*OutputStats) ProtoMessage

func (*OutputStats) ProtoMessage()

func (*OutputStats) Reset

func (m *OutputStats) Reset()

func (*OutputStats) Size

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

func (*OutputStats) String

func (m *OutputStats) String() string

func (*OutputStats) Unmarshal

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

func (*OutputStats) XXX_DiscardUnknown

func (m *OutputStats) XXX_DiscardUnknown()

func (*OutputStats) XXX_Marshal

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

func (*OutputStats) XXX_Merge

func (dst *OutputStats) XXX_Merge(src proto.Message)

func (*OutputStats) XXX_Size

func (m *OutputStats) XXX_Size() int

func (*OutputStats) XXX_Unmarshal

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

type OutputStatus

type OutputStatus struct {
	IsReferred    bool                                 `protobuf:"varint,1,opt,name=is_referred,json=isReferred,proto3" json:"is_referred,omitempty"`
	IsSpent       bool                                 `protobuf:"varint,2,opt,name=is_spent,json=isSpent,proto3" json:"is_spent,omitempty"`
	Locked        github_com_AidosKuneen_aklib_tx.Hash `protobuf:"bytes,3,opt,name=locked,proto3,casttype=github.com/AidosKuneen/aklib/tx.Hash" json:"locked,omitempty"`
	UsedByMinable []byte                               `protobuf:"bytes,4,opt,name=used_by_minable,json=usedByMinable,proto3" json:"used_by_minable,omitempty"`
}

OutputStatus is status of an output.

func NewPopulatedOutputStatus

func NewPopulatedOutputStatus(r randyImesh, easy bool) *OutputStatus

func (*OutputStatus) Descriptor

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

func (*OutputStatus) Equal

func (this *OutputStatus) Equal(that interface{}) bool

func (*OutputStatus) Marshal

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

func (*OutputStatus) MarshalTo

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

func (*OutputStatus) ProtoMessage

func (*OutputStatus) ProtoMessage()

func (*OutputStatus) Reset

func (m *OutputStatus) Reset()

func (*OutputStatus) Size

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

func (*OutputStatus) String

func (m *OutputStatus) String() string

func (*OutputStatus) Unmarshal

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

func (*OutputStatus) XXX_DiscardUnknown

func (m *OutputStatus) XXX_DiscardUnknown()

func (*OutputStatus) XXX_Marshal

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

func (*OutputStatus) XXX_Merge

func (dst *OutputStatus) XXX_Merge(src proto.Message)

func (*OutputStatus) XXX_Size

func (m *OutputStatus) XXX_Size() int

func (*OutputStatus) XXX_Unmarshal

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

type PrevToTx

type PrevToTx struct {
	Time time.Time `protobuf:"bytes,1,opt,name=time,proto3,stdtime" json:"time"`
}

func NewPopulatedPrevToTx

func NewPopulatedPrevToTx(r randyImesh, easy bool) *PrevToTx

func (*PrevToTx) Descriptor

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

func (*PrevToTx) Equal

func (this *PrevToTx) Equal(that interface{}) bool

func (*PrevToTx) Marshal

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

func (*PrevToTx) MarshalTo

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

func (*PrevToTx) ProtoMessage

func (*PrevToTx) ProtoMessage()

func (*PrevToTx) Reset

func (m *PrevToTx) Reset()

func (*PrevToTx) Size

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

func (*PrevToTx) String

func (m *PrevToTx) String() string

func (*PrevToTx) Unmarshal

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

func (*PrevToTx) XXX_DiscardUnknown

func (m *PrevToTx) XXX_DiscardUnknown()

func (*PrevToTx) XXX_Marshal

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

func (*PrevToTx) XXX_Merge

func (dst *PrevToTx) XXX_Merge(src proto.Message)

func (*PrevToTx) XXX_Size

func (m *PrevToTx) XXX_Size() int

func (*PrevToTx) XXX_Unmarshal

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

type Richlist

type Richlist struct {
	Rank    int64  `protobuf:"varint,1,opt,name=rank,proto3" json:"rank,omitempty"`
	Address string `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"`
	Balance int64  `protobuf:"varint,3,opt,name=balance,proto3" json:"balance,omitempty"`
}

Richlist holds an address with its balance

func GetRichlist

func GetRichlist(s *setting.Setting, skip, num int) ([]*Richlist, error)

GetRichlist returns the richlist.

func GetRichlistAround

func GetRichlistAround(s *setting.Setting, adr string, num int) ([]*Richlist, int, error)

GetRichlistAround returns a richlist around the address.

func NewPopulatedRichlist

func NewPopulatedRichlist(r randyImesh, easy bool) *Richlist

func (*Richlist) Descriptor

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

func (*Richlist) Equal

func (this *Richlist) Equal(that interface{}) bool

func (*Richlist) Marshal

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

func (*Richlist) MarshalTo

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

func (*Richlist) ProtoMessage

func (*Richlist) ProtoMessage()

func (*Richlist) Reset

func (m *Richlist) Reset()

func (*Richlist) Size

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

func (*Richlist) String

func (m *Richlist) String() string

func (*Richlist) Unmarshal

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

func (*Richlist) XXX_DiscardUnknown

func (m *Richlist) XXX_DiscardUnknown()

func (*Richlist) XXX_Marshal

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

func (*Richlist) XXX_Merge

func (dst *Richlist) XXX_Merge(src proto.Message)

func (*Richlist) XXX_Size

func (m *Richlist) XXX_Size() int

func (*Richlist) XXX_Unmarshal

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

type Status

type Status byte

Status represents the status(confirm or not) of tx.

const (
	Pending Status = iota + 1
	Accepted
	Rejected
)

Status of a tx.

func PrepareConfirmation

func PrepareConfirmation(s *setting.Setting, h tx.Hash) (Status, error)

PrepareConfirmation returns tx status which the tx should be when confirmation will take place.

func (Status) String

func (s Status) String() string

type Time

type Time struct {
	Time time.Time `protobuf:"bytes,1,opt,name=time,proto3,stdtime" json:"time"`
}

func NewPopulatedTime

func NewPopulatedTime(r randyImesh, easy bool) *Time

func (*Time) Descriptor

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

func (*Time) Equal

func (this *Time) Equal(that interface{}) bool

func (*Time) Marshal

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

func (*Time) MarshalTo

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

func (*Time) ProtoMessage

func (*Time) ProtoMessage()

func (*Time) Reset

func (m *Time) Reset()

func (*Time) Size

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

func (*Time) String

func (m *Time) String() string

func (*Time) Unmarshal

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

func (*Time) XXX_DiscardUnknown

func (m *Time) XXX_DiscardUnknown()

func (*Time) XXX_Marshal

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

func (*Time) XXX_Merge

func (dst *Time) XXX_Merge(src proto.Message)

func (*Time) XXX_Size

func (m *Time) XXX_Size() int

func (*Time) XXX_Unmarshal

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

type Transaction

type Transaction struct {
	*Body         `protobuf:"bytes,1,opt,name=body,proto3,embedded=body" json:"body,omitempty"`
	tx.Signatures `protobuf:"bytes,2,opt,name=signatures,proto3,embedded=signatures" json:"signatures"`
}

Transaction is a transactio in Aidos Kuneen.

func NewPopulatedTransaction

func NewPopulatedTransaction(r randyImesh, easy bool) *Transaction

func (*Transaction) Descriptor

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

func (*Transaction) Equal

func (this *Transaction) Equal(that interface{}) bool

func (*Transaction) Marshal

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

func (*Transaction) MarshalTo

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

func (*Transaction) ProtoMessage

func (*Transaction) ProtoMessage()

func (*Transaction) Reset

func (m *Transaction) Reset()

func (*Transaction) Size

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

func (*Transaction) String

func (m *Transaction) String() string

func (*Transaction) Unmarshal

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

func (*Transaction) XXX_DiscardUnknown

func (m *Transaction) XXX_DiscardUnknown()

func (*Transaction) XXX_Marshal

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

func (*Transaction) XXX_Merge

func (dst *Transaction) XXX_Merge(src proto.Message)

func (*Transaction) XXX_Size

func (m *Transaction) XXX_Size() int

func (*Transaction) XXX_Unmarshal

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

type TxInfo

type TxInfo struct {
	Hash         github_com_AidosKuneen_aklib_tx.Hash `protobuf:"bytes,1,opt,name=hash,proto3,casttype=github.com/AidosKuneen/aklib/tx.Hash" json:"hash,omitempty"`
	Body         *tx.Body                             `protobuf:"bytes,2,opt,name=body,proto3" json:"body,omitempty"`
	TxNo         uint64                               `protobuf:"varint,3,opt,name=tx_no,json=txNo,proto3" json:"tx_no,omitempty"`
	IsRejected   bool                                 `protobuf:"varint,4,opt,name=is_rejected,json=isRejected,proto3" json:"is_rejected,omitempty"`
	ConfirmedAt  uint32                               `protobuf:"varint,5,opt,name=confirmed_at,json=confirmedAt,proto3" json:"confirmed_at,omitempty"`
	Received     time.Time                            `protobuf:"bytes,6,opt,name=received,proto3,stdtime" json:"received"`
	OutputStatus []OutputStats                        `protobuf:"bytes,7,rep,name=output_status,json=outputStatus,proto3" json:"output_status"`
}

TxInfo is for tx in db with sighash and status. Never save TxInfo to DB without cares, or DB conflicts occurs

func GetTxInfo

func GetTxInfo(akdb *bolt.DB, h tx.Hash) (*TxInfo, error)

GetTxInfo gets a transaction info. Never save the TxInfo to db without care, or db conflicts occur.

func GetTxInfoTxn

func GetTxInfoTxn(txn *bolt.Bucket, h tx.Hash) (*TxInfo, error)

GetTxInfoTxn gets a transaction info.

func NewPopulatedTxInfo

func NewPopulatedTxInfo(r randyImesh, easy bool) *TxInfo

func (*TxInfo) Descriptor

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

func (*TxInfo) Equal

func (this *TxInfo) Equal(that interface{}) bool

func (*TxInfo) GetLocalStatus

func (ti *TxInfo) GetLocalStatus() Status

GetLocalStatus returns the status in local imesh if pending confirmed or accepted.

func (*TxInfo) Marshal

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

func (*TxInfo) MarshalTo

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

func (*TxInfo) ProtoMessage

func (*TxInfo) ProtoMessage()

func (*TxInfo) Put

func (ti *TxInfo) Put(akdb *bolt.DB) error

Put put the tx into db. It should be used only by akwallet.

func (*TxInfo) Reset

func (m *TxInfo) Reset()

func (*TxInfo) Size

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

func (*TxInfo) String

func (m *TxInfo) String() string

func (*TxInfo) Unmarshal

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

func (*TxInfo) XXX_DiscardUnknown

func (m *TxInfo) XXX_DiscardUnknown()

func (*TxInfo) XXX_Marshal

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

func (*TxInfo) XXX_Merge

func (dst *TxInfo) XXX_Merge(src proto.Message)

func (*TxInfo) XXX_Size

func (m *TxInfo) XXX_Size() int

func (*TxInfo) XXX_Unmarshal

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

type TxWithType

type TxWithType struct {
	Type github_com_AidosKuneen_aklib_tx.Type `protobuf:"varint,1,opt,name=type,proto3,casttype=github.com/AidosKuneen/aklib/tx.Type" json:"type,omitempty"`
	Tr   *tx.Transaction                      `protobuf:"bytes,2,opt,name=tr,proto3" json:"tr,omitempty"`
}

TxWithType is tx.Transaction with its type.

func CheckAdd

func CheckAdd(s *setting.Setting, trs *tx.Transaction, typ tx.Type) ([]*TxWithType, []tx.Hash, error)

CheckAdd checks trs and leaves if these are leaves and add them.

func CheckAdds

func CheckAdds(s *setting.Setting, trs []*TxWithType) ([]*TxWithType, []tx.Hash, error)

CheckAdds checks trs and leaves if these are leaves and add them.

func NewPopulatedTxWithType

func NewPopulatedTxWithType(r randyImesh, easy bool) *TxWithType

func (*TxWithType) Descriptor

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

func (*TxWithType) Equal

func (this *TxWithType) Equal(that interface{}) bool

func (*TxWithType) Marshal

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

func (*TxWithType) MarshalTo

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

func (*TxWithType) ProtoMessage

func (*TxWithType) ProtoMessage()

func (*TxWithType) Reset

func (m *TxWithType) Reset()

func (*TxWithType) Size

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

func (*TxWithType) String

func (m *TxWithType) String() string

func (*TxWithType) Unmarshal

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

func (*TxWithType) XXX_DiscardUnknown

func (m *TxWithType) XXX_DiscardUnknown()

func (*TxWithType) XXX_Marshal

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

func (*TxWithType) XXX_Merge

func (dst *TxWithType) XXX_Merge(src proto.Message)

func (*TxWithType) XXX_Size

func (m *TxWithType) XXX_Size() int

func (*TxWithType) XXX_Unmarshal

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

type UnresolvedPrevHashes

type UnresolvedPrevHashes struct {
	Hashes []github_com_AidosKuneen_aklib_tx.Hash `protobuf:"bytes,1,rep,name=hashes,proto3,casttype=github.com/AidosKuneen/aklib/tx.Hash" json:"hashes,omitempty"`
}

func NewPopulatedUnresolvedPrevHashes

func NewPopulatedUnresolvedPrevHashes(r randyImesh, easy bool) *UnresolvedPrevHashes

func (*UnresolvedPrevHashes) Descriptor

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

func (*UnresolvedPrevHashes) Equal

func (this *UnresolvedPrevHashes) Equal(that interface{}) bool

func (*UnresolvedPrevHashes) Marshal

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

func (*UnresolvedPrevHashes) MarshalTo

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

func (*UnresolvedPrevHashes) ProtoMessage

func (*UnresolvedPrevHashes) ProtoMessage()

func (*UnresolvedPrevHashes) Reset

func (m *UnresolvedPrevHashes) Reset()

func (*UnresolvedPrevHashes) Size

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

func (*UnresolvedPrevHashes) String

func (m *UnresolvedPrevHashes) String() string

func (*UnresolvedPrevHashes) Unmarshal

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

func (*UnresolvedPrevHashes) XXX_DiscardUnknown

func (m *UnresolvedPrevHashes) XXX_DiscardUnknown()

func (*UnresolvedPrevHashes) XXX_Marshal

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

func (*UnresolvedPrevHashes) XXX_Merge

func (dst *UnresolvedPrevHashes) XXX_Merge(src proto.Message)

func (*UnresolvedPrevHashes) XXX_Size

func (m *UnresolvedPrevHashes) XXX_Size() int

func (*UnresolvedPrevHashes) XXX_Unmarshal

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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