transaction

package
v0.0.0-...-ed99955 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckConsensusTx

func CheckConsensusTx(consensus *Request_Consensus) bool

Types

type NewBlock

type NewBlock struct {
	Height   int64      `json:"height"`
	Pubkey   string     `json:"pubkey"`
	Nodes    []string   `json:"nodes"`
	Leader   bool       `json:"leader"`
	Swaps    [][]string `json:"swaps"`
	Requests [][]string `json:"requests"`
}

type OracleData

type OracleData struct {
	Hash      string  `json:"hash"`
	Price     float64 `json:"price"`
	Height    int64   `json:"height"`
	Contract  string  `json:"contract"`
	Pubkey    string  `json:"pubkey"`
	Signature string  `json:"signature"`
}

type Request_Consensus

type Request_Consensus struct {
	Hash      string   `json:"hash"`
	PubKey    string   `json:"pubkey"`
	Signature string   `json:"signature"`
	Data      []string `json:"data"`
	Task      string   `json:"task"`
	Height    int64    `json:"height"`
}

type Request_Contract

type Request_Contract struct {
	Asset string `json:asset`
	Denom string `json:denom`
}

type Request_Oracle_Data

type Request_Oracle_Data struct {
	Hash      string `json:"hash"`
	PubKey    string `json:"pubkey"`
	Signature string `json:"signature"`
	Data      string `json:"data"`
	Task      string `json:"task"`
	Height    string `json:"height"`
	Source    string `json:"source"`
	Epoc      string `json:"epoc"`
}

type Transaction

type Transaction struct {
	Time   string `json:"time" db:"tx_time"`
	Type   string `json:"type" db:"tx_type"`
	Hash   string `json:"hash" db:"tx_hash"`
	Data   string `json:"data" db:"tx_data"`
	Prev   string `json:"prev" db:"tx_prev"`
	Epoc   string `json:"epoc" db:"tx_epoc"`
	Subg   string `json:"subg" db:"tx_subg"`
	Prnt   string `json:"prnt" db:"tx_prnt"`
	Mile   bool   `json:"mile" db:"tx_mile"`
	Lead   bool   `json:"lead" db:"tx_lead"`
	Height int64  `json:"height" db:"tx_height"`
}

Transaction This is the structure of the transaction

func CreateTransaction

func CreateTransaction(txType, last_epoc_tx string, data []byte, txhash_on_epoc []string, txdata_on_epoc []string, height int64) Transaction

func CreateTrustedTransaction

func CreateTrustedTransaction(prev string, trusted_data Trusted_Data) Transaction

func DeserializeTransaction

func DeserializeTransaction(data []byte) Transaction

func (*Transaction) ParseInterface

func (tx *Transaction) ParseInterface() interface{}

func (*Transaction) Serialize

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

type Trusted_Data

type Trusted_Data struct {
	TrustedData   []OracleData `json:"trusted_data"`
	TrustedAnswer float64      `json:trusted_answer`
}

Jump to

Keyboard shortcuts

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