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: ? 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

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