v5

package
v6.0.0-...-31b3adf Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetMetadataDatumMapV5

func GetMetadataDatumMapV5(txMetadata json.RawMessage, metadataDatumKey int) (map[string][]byte, error)

func GetMetadataDatumsV5

func GetMetadataDatumsV5(txMetadata json.RawMessage, metadataDatumKey int) ([][]byte, error)

Types

type BlockHeaderV5

type BlockHeaderV5 struct {
	BlockHash       string                 `json:"blockHash,omitempty"       dynamodbav:"blockHash,omitempty"`
	BlockHeight     uint64                 `json:"blockHeight,omitempty"     dynamodbav:"blockHeight,omitempty"`
	BlockSize       uint64                 `json:"blockSize,omitempty"       dynamodbav:"blockSize,omitempty"`
	IssuerVK        string                 `json:"issuerVK,omitempty"        dynamodbav:"issuerVK,omitempty"`
	IssuerVrf       string                 `json:"issuerVrf,omitempty"       dynamodbav:"issuerVrf,omitempty"`
	LeaderValue     map[string][]byte      `json:"leaderValue,omitempty"     dynamodbav:"leaderValue,omitempty"`
	Nonce           map[string]string      `json:"nonce,omitempty"           dynamodbav:"nonce,omitempty"`
	OpCert          map[string]interface{} `json:"opCert,omitempty"          dynamodbav:"opCert,omitempty"`
	PrevHash        string                 `json:"prevHash,omitempty"        dynamodbav:"prevHash,omitempty"`
	ProtocolVersion map[string]int         `json:"protocolVersion,omitempty" dynamodbav:"protocolVersion,omitempty"`
	Signature       string                 `json:"signature,omitempty"       dynamodbav:"signature,omitempty"`
	Slot            uint64                 `json:"slot,omitempty"            dynamodbav:"slot,omitempty"`
}

type BlockV5

type BlockV5 struct {
	Body       []TxV5        `json:"body,omitempty"       dynamodbav:"body,omitempty"`
	Header     BlockHeaderV5 `json:"header,omitempty"     dynamodbav:"header,omitempty"`
	HeaderHash string        `json:"headerHash,omitempty" dynamodbav:"headerHash,omitempty"`
}

func (BlockV5) PointStruct

func (b BlockV5) PointStruct() PointStructV5

Assume no Byron support.

type ByronBlock

type ByronBlock struct {
	Body   ByronBody
	Hash   string
	Header ByronHeader
}

type ByronBody

type ByronBody struct {
	DlgPayload    []json.RawMessage `json:"dlgPayload,omitempty"`
	TxPayload     []ByronTxPayload  `json:"txPayload,omitempty"`
	UpdatePayload json.RawMessage   `json:"updatePayload,omitempty"`
}

type ByronHeader

type ByronHeader struct {
	BlockHeight     uint64 `json:"blockHeight,omitempty"`
	GenesisKey      string
	Epoch           uint32
	Proof           json.RawMessage
	PrevHash        string
	ProtocolMagicId uint64
	ProtocolVersion chainsync.ProtocolVersion
	Signature       json.RawMessage
	Slot            uint64 `json:"slot,omitempty"`
	SoftwareVersion map[string]interface{}
}

type ByronTxBody

type ByronTxBody struct {
	Inputs  []chainsync.TxIn
	Outputs []chainsync.TxOut
}

type ByronTxPayload

type ByronTxPayload struct {
	ID      string
	Witness []ByronWitness
}

type ByronWitness

type ByronWitness struct {
	RedeemWitness map[string]string
}

type IntersectionFoundV5

type IntersectionFoundV5 struct {
	Point *PointV5
	Tip   *PointStructV5
}

type IntersectionNotFoundV5

type IntersectionNotFoundV5 struct {
	Tip *PointStructV5
}

type OgmiosAuxiliaryDataV5

type OgmiosAuxiliaryDataV5 struct {
	Hash string                     `json:"hash"`
	Body *OgmiosAuxiliaryDataV5Body `json:"body"`
}

func OgmiosAuxiliaryDataFromV6

func OgmiosAuxiliaryDataFromV6(t chainsync.OgmiosAuxiliaryDataV6) (OgmiosAuxiliaryDataV5, error)

NOTE: This works only for JSON metadata. Entries with CBOR metadata are ignored.

func (OgmiosAuxiliaryDataV5) ConvertToV6

type OgmiosAuxiliaryDataV5Body

type OgmiosAuxiliaryDataV5Body struct {
	Blob OgmiosMetadataV5 `json:"blob"`
}

type OgmiosMetadataV5

type OgmiosMetadataV5 map[int]chainsync.OgmiosMetadatum

type PointStructV5

type PointStructV5 struct {
	BlockNo uint64 `json:"blockNo,omitempty" dynamodbav:"blockNo,omitempty"`
	Hash    string `json:"hash,omitempty"    dynamodbav:"hash,omitempty"` // BLAKE2b_256 hash
	Slot    uint64 `json:"slot,omitempty"    dynamodbav:"slot,omitempty"`
}

func (PointStructV5) ConvertToV6

func (p PointStructV5) ConvertToV6() chainsync.PointStruct

func (PointStructV5) Point

func (p PointStructV5) Point() PointV5

type PointV5

type PointV5 struct {
	// contains filtered or unexported fields
}

func PointFromV6

func PointFromV6(p chainsync.Point) *PointV5

func (PointV5) ConvertToV6

func (p PointV5) ConvertToV6() chainsync.Point

func (PointV5) MarshalCBOR

func (p PointV5) MarshalCBOR() ([]byte, error)

func (PointV5) MarshalJSON

func (p PointV5) MarshalJSON() ([]byte, error)

func (PointV5) PointString

func (p PointV5) PointString() (chainsync.PointString, bool)

func (PointV5) PointStruct

func (p PointV5) PointStruct() (*PointStructV5, bool)

func (PointV5) PointType

func (p PointV5) PointType() chainsync.PointType

func (PointV5) String

func (p PointV5) String() string

func (*PointV5) UnmarshalCBOR

func (p *PointV5) UnmarshalCBOR(data []byte) error

func (*PointV5) UnmarshalJSON

func (p *PointV5) UnmarshalJSON(data []byte) error

type PointsV5

type PointsV5 []PointV5

func (PointsV5) ConvertToV6

func (pp PointsV5) ConvertToV6() chainsync.Points

func (PointsV5) String

func (pp PointsV5) String() string

type ResponseV5

type ResponseV5 struct {
	Type        string          `json:"type,omitempty"        dynamodbav:"type,omitempty"`
	Version     string          `json:"version,omitempty"     dynamodbav:"version,omitempty"`
	ServiceName string          `json:"servicename,omitempty" dynamodbav:"servicename,omitempty"`
	MethodName  string          `json:"methodname,omitempty"  dynamodbav:"methodname,omitempty"`
	Result      *ResultV5       `json:"result,omitempty"      dynamodbav:"result,omitempty"`
	Reflection  json.RawMessage `json:"reflection,omitempty"  dynamodbav:"reflection,omitempty"`
}

func ResponseFromV6

func ResponseFromV6(r chainsync.ResponsePraos) ResponseV5

I don't really understand the nest of types here...

func (ResponseV5) ConvertToV6

func (r ResponseV5) ConvertToV6() chainsync.ResponsePraos

type ResultFindIntersectionV5

type ResultFindIntersectionV5 struct {
	IntersectionFound    *IntersectionFoundV5    `json:",omitempty" dynamodbav:",omitempty"`
	IntersectionNotFound *IntersectionNotFoundV5 `json:",omitempty" dynamodbav:",omitempty"`
}

func (ResultFindIntersectionV5) ConvertToV6

type ResultNextBlockV5

type ResultNextBlockV5 struct {
	RollForward  *RollForwardV5  `json:",omitempty" dynamodbav:",omitempty"`
	RollBackward *RollBackwardV5 `json:",omitempty" dynamodbav:",omitempty"`
}

func (ResultNextBlockV5) ConvertToV6

type ResultV5

type ResultV5 struct {
	IntersectionFound    *IntersectionFoundV5    `json:",omitempty" dynamodbav:",omitempty"`
	IntersectionNotFound *IntersectionNotFoundV5 `json:",omitempty" dynamodbav:",omitempty"`
	RollForward          *RollForwardV5          `json:",omitempty" dynamodbav:",omitempty"`
	RollBackward         *RollBackwardV5         `json:",omitempty" dynamodbav:",omitempty"`
}

TODO: why do we have two types here?

type RollBackwardV5

type RollBackwardV5 struct {
	Point PointV5       `json:"point,omitempty" dynamodbav:"point,omitempty"`
	Tip   PointStructV5 `json:"tip,omitempty"   dynamodbav:"tip,omitempty"`
}

type RollForwardBlockV5

type RollForwardBlockV5 struct {
	Allegra *BlockV5    `json:"allegra,omitempty" dynamodbav:"allegra,omitempty"`
	Alonzo  *BlockV5    `json:"alonzo,omitempty"  dynamodbav:"alonzo,omitempty"`
	Babbage *BlockV5    `json:"babbage,omitempty" dynamodbav:"babbage,omitempty"`
	Byron   *ByronBlock `json:"byron,omitempty"   dynamodbav:"byron,omitempty"`
	Mary    *BlockV5    `json:"mary,omitempty"    dynamodbav:"mary,omitempty"`
	Shelley *BlockV5    `json:"shelley,omitempty" dynamodbav:"shelley,omitempty"`
}

func BlockFromV6

func BlockFromV6(b chainsync.Block) (RollForwardBlockV5, error)

func (RollForwardBlockV5) ConvertToV6

func (b RollForwardBlockV5) ConvertToV6() (chainsync.Block, error)

func (RollForwardBlockV5) Era

func (b RollForwardBlockV5) Era() string

func (RollForwardBlockV5) GetNonByronBlock

func (b RollForwardBlockV5) GetNonByronBlock() *BlockV5

type RollForwardV5

type RollForwardV5 struct {
	Block RollForwardBlockV5 `json:"block,omitempty" dynamodbav:"block,omitempty"`
	Tip   PointStructV5      `json:"tip,omitempty"   dynamodbav:"tip,omitempty"`
}

type TxBodyV5

type TxBodyV5 struct {
	Certificates            []json.RawMessage  `json:"certificates,omitempty"            dynamodbav:"certificates,omitempty"`
	Collaterals             TxInsV5            `json:"collaterals,omitempty"             dynamodbav:"collaterals,omitempty"`
	Fee                     num.Int            `json:"fee,omitempty"                     dynamodbav:"fee,omitempty"`
	Inputs                  TxInsV5            `json:"inputs,omitempty"                  dynamodbav:"inputs,omitempty"`
	Mint                    *ValueV5           `json:"mint,omitempty"                    dynamodbav:"mint,omitempty"`
	Network                 json.RawMessage    `json:"network,omitempty"                 dynamodbav:"network,omitempty"`
	Outputs                 TxOutsV5           `json:"outputs,omitempty"                 dynamodbav:"outputs,omitempty"`
	RequiredExtraSignatures []string           `json:"requiredExtraSignatures,omitempty" dynamodbav:"requiredExtraSignatures,omitempty"`
	ScriptIntegrityHash     string             `json:"scriptIntegrityHash,omitempty"     dynamodbav:"scriptIntegrityHash,omitempty"`
	TimeToLive              int64              `json:"timeToLive,omitempty"              dynamodbav:"timeToLive,omitempty"`
	Update                  json.RawMessage    `json:"update,omitempty"                  dynamodbav:"update,omitempty"`
	ValidityInterval        ValidityIntervalV5 `json:"validityInterval"                  dynamodbav:"validityInterval,omitempty"`
	Withdrawals             map[string]int64   `json:"withdrawals,omitempty"             dynamodbav:"withdrawals,omitempty"`
	CollateralReturn        *TxOutV5           `json:"collateralReturn,omitempty"        dynamodbav:"collateralReturn,omitempty"`
	TotalCollateral         *int64             `json:"totalCollateral,omitempty"         dynamodbav:"totalCollateral,omitempty"`
	References              TxInsV5            `json:"references,omitempty"              dynamodbav:"references,omitempty"`
}

type TxInV5

type TxInV5 struct {
	TxHash string `json:"txId"  dynamodbav:"txId"`
	Index  int    `json:"index" dynamodbav:"index"`
}

func InputFromV6

func InputFromV6(t chainsync.TxIn) TxInV5

func (TxInV5) ConvertToV6

func (t TxInV5) ConvertToV6() chainsync.TxIn

func (TxInV5) String

func (t TxInV5) String() string

type TxInsV5

type TxInsV5 []TxInV5

func InputsFromV6

func InputsFromV6(t chainsync.TxIns) TxInsV5

func (TxInsV5) ConvertToV6

func (t TxInsV5) ConvertToV6() chainsync.TxIns

type TxOutV5

type TxOutV5 struct {
	Address   string          `json:"address,omitempty"   dynamodbav:"address,omitempty"`
	Datum     string          `json:"datum,omitempty"     dynamodbav:"datum,omitempty"`
	DatumHash string          `json:"datumHash,omitempty" dynamodbav:"datumHash,omitempty"`
	Value     ValueV5         `json:"value,omitempty"     dynamodbav:"value,omitempty"`
	Script    json.RawMessage `json:"script,omitempty"    dynamodbav:"script,omitempty"`
}

func TxOutFromV6

func TxOutFromV6(t chainsync.TxOut) TxOutV5

func (TxOutV5) ConvertToV6

func (t TxOutV5) ConvertToV6() chainsync.TxOut

type TxOutsV5

type TxOutsV5 []TxOutV5

func TxOutsFromV6

func TxOutsFromV6(t chainsync.TxOuts) TxOutsV5

func (TxOutsV5) ConvertToV6

func (t TxOutsV5) ConvertToV6() chainsync.TxOuts

func (TxOutsV5) FindByAssetID

func (tt TxOutsV5) FindByAssetID(assetID shared.AssetID) (TxOutV5, bool)

type TxV5

type TxV5 struct {
	ID          string            `json:"id,omitempty"       dynamodbav:"id,omitempty"`
	InputSource string            `json:"inputSource,omitempty"  dynamodbav:"inputSource,omitempty"`
	Body        TxBodyV5          `json:"body,omitempty"     dynamodbav:"body,omitempty"`
	Witness     chainsync.Witness `json:"witness,omitempty"  dynamodbav:"witness,omitempty"`
	Metadata    json.RawMessage   `json:"metadata,omitempty" dynamodbav:"metadata,omitempty"`
	// Raw serialized transaction, base64.
	Raw string `json:"raw,omitempty" dynamodbav:"raw,omitempty"`
}

Use V5 materials only for JSON backwards compatibility.

func TxFromV6

func TxFromV6(t chainsync.Tx) TxV5

func (TxV5) ConvertToV6

func (t TxV5) ConvertToV6() chainsync.Tx

CAVEAT: v5->v6 conversion is, to some degree, best-effort-only. For example, some fields in v6 (e.g., "requiredExtraScripts" and "votes") either aren't represented in v5 or are represented such that it's very difficult, if not impossible, to determine if it's okay to populate the relevant fields in v6. (Example: The "scripts" field in v5 and v6 may contain scripts that aren't considered required in v6.)

type ValidityIntervalV5

type ValidityIntervalV5 struct {
	InvalidBefore    uint64 `json:"invalidBefore,omitempty"     dynamodbav:"invalidBefore,omitempty"`
	InvalidHereafter uint64 `json:"invalidHereafter,omitempty"  dynamodbav:"invalidHereafter,omitempty"`
}

func (ValidityIntervalV5) ConvertToV6

type ValueV5

type ValueV5 struct {
	Coins  num.Int                    `json:"coins,omitempty"  dynamodbav:"coins,omitempty"`
	Assets map[shared.AssetID]num.Int `json:"assets" dynamodbav:"assets,omitempty"`
}

func ValueFromV6

func ValueFromV6(v shared.Value) ValueV5

func (ValueV5) ConvertToV6

func (v ValueV5) ConvertToV6() shared.Value

Jump to

Keyboard shortcuts

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