oracle

package
v0.0.0-...-1c741c1 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2019 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ByteMsgsToNumber

func ByteMsgsToNumber(msgs [][]byte) int

ByteMsgsToNumber converts byte messages to number value

func NumberToByteMsgs

func NumberToByteMsgs(v int, nDigits int) [][]byte

NumberToByteMsgs converts number value to byte messages

Types

type PubkeySet

type PubkeySet struct {
	Pubkey           *btcec.PublicKey
	CommittedRpoints []*btcec.PublicKey
}

PubkeySet contains oracle's pub key and keys for all rate

func (PubkeySet) JSON

func (pubset PubkeySet) JSON() *PubkeySetJSON

JSON returns PubkeySetJSON

func (PubkeySet) MarshalJSON

func (pubset PubkeySet) MarshalJSON() ([]byte, error)

MarshalJSON serialize PubkeySet to JSON

func (*PubkeySet) ParseJSON

func (pubset *PubkeySet) ParseJSON(pjson *PubkeySetJSON) error

ParseJSON parses PubkeySetJSON

func (*PubkeySet) UnmarshalJSON

func (pubset *PubkeySet) UnmarshalJSON(data []byte) error

UnmarshalJSON deserialize JSON to PubkeySet

type PubkeySetJSON

type PubkeySetJSON struct {
	Pubkey           string   `json:"pubkey"`
	CommittedRpoints []string `json:"rpoints"`
}

PubkeySetJSON is serialized PubkeySet

type SignedMsg

type SignedMsg struct {
	Msgs [][]byte
	Sigs [][]byte
}

SignedMsg contains fixed messages and signatures

func (SignedMsg) MarshalJSON

func (sm SignedMsg) MarshalJSON() ([]byte, error)

MarshalJSON serialize SignSet to JSON

func (*SignedMsg) UnmarshalJSON

func (sm *SignedMsg) UnmarshalJSON(data []byte) error

UnmarshalJSON deserialize JSON to SignedMsg

type SignedMsgJSON

type SignedMsgJSON struct {
	Value int      `json:"value"`
	Sigs  []string `json:"sigs"`
}

SignedMsgJSON is siged message in JSON format

Jump to

Keyboard shortcuts

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