transactions

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Commit            TxFunc = "commit"
	Reveal            TxFunc = "reveal"
	AddOracle         TxFunc = "addOracle"
	AddOracleInNebula TxFunc = "addOracleInNebula"
	Result            TxFunc = "result"
	NewRound          TxFunc = "newRound"
	Vote              TxFunc = "vote"
	SetNebula         TxFunc = "setNebula"
	SignNewConsuls    TxFunc = "signNewConsuls"
	SignNewOracles    TxFunc = "signNewOracles"
	ApproveLastRound  TxFunc = "approveLastRound"

	String Type = "string"
	Int    Type = "int"
	Bytes  Type = "bytes"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Arg

type Arg struct {
	Type  Type
	Value []byte
}

type BytesValue

type BytesValue struct {
	Value []byte
}

type ID

type ID [32]byte

func (ID) Bytes

func (id ID) Bytes() []byte

type IntValue

type IntValue struct {
	Value int64
}

type StringValue

type StringValue struct {
	Value string
}

type Transaction

type Transaction struct {
	Id           ID
	SenderPubKey account.ConsulPubKey
	Signature    [72]byte
	Func         TxFunc
	Timestamp    uint64
	Args         []Arg
}

func New

func New(pubKey account.ConsulPubKey, funcName TxFunc, privKey tCrypto.PrivKey) (*Transaction, error)

func UnmarshalJson

func UnmarshalJson(data []byte) (*Transaction, error)

func (*Transaction) AddValue

func (tx *Transaction) AddValue(value Value)

func (*Transaction) AddValues

func (tx *Transaction) AddValues(values []Value)

func (*Transaction) Bytes

func (tx *Transaction) Bytes() []byte

func (*Transaction) Hash

func (tx *Transaction) Hash()

func (*Transaction) Sign

func (tx *Transaction) Sign(privKey tCrypto.PrivKey) error

func (*Transaction) Value

func (tx *Transaction) Value(index int) interface{}

type TxFunc

type TxFunc string

type Type

type Type string

type Value

type Value interface{}

Jump to

Keyboard shortcuts

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