change

package
v0.22.119 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2022 License: ISC Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const ClaimIDSize = 20

ClaimID represents a Claim's ClaimID.

Variables

This section is empty.

Functions

This section is empty.

Types

type Change

type Change struct {
	Type   ChangeType
	Height int32

	Name     []byte
	ClaimID  ClaimID
	OutPoint wire.OutPoint
	Amount   int64

	ActiveHeight  int32
	VisibleHeight int32 // aka, CreatedAt; used for normalization fork

	SpentChildren map[string]bool
}

func NewChange

func NewChange(typ ChangeType) Change

func (*Change) Marshal

func (c *Change) Marshal(enc *bytes.Buffer) error

func (Change) SetAmount

func (c Change) SetAmount(amt int64) Change

func (Change) SetHeight

func (c Change) SetHeight(height int32) Change

func (Change) SetName

func (c Change) SetName(name []byte) Change

func (Change) SetOutPoint

func (c Change) SetOutPoint(op *wire.OutPoint) Change

func (*Change) Unmarshal

func (c *Change) Unmarshal(dec *bytes.Buffer) error

type ChangeType

type ChangeType uint32
const (
	AddClaim ChangeType = iota
	SpendClaim
	UpdateClaim
	AddSupport
	SpendSupport
)

type ClaimID

type ClaimID [ClaimIDSize]byte

func NewClaimID

func NewClaimID(op wire.OutPoint) (id ClaimID)

NewClaimID returns a Claim ID calculated from Ripemd160(Sha256(OUTPOINT).

func NewIDFromString

func NewIDFromString(s string) (id ClaimID, err error)

NewIDFromString returns a Claim ID from a string.

func (ClaimID) Key

func (id ClaimID) Key() string

Key is for in-memory maps

func (ClaimID) String

func (id ClaimID) String() string

String is for anything written to a DB

Jump to

Keyboard shortcuts

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