Documentation ¶
Index ¶
- Constants
- Variables
- func IsEmbeddedAddress(addr Address) bool
- type AccountHeader
- type AccountHeaderProto
- func (*AccountHeaderProto) Descriptor() ([]byte, []int)
- func (m *AccountHeaderProto) GetAddress() *AddressProto
- func (m *AccountHeaderProto) GetHashHeight() *HashHeightProto
- func (*AccountHeaderProto) ProtoMessage()
- func (m *AccountHeaderProto) Reset()
- func (m *AccountHeaderProto) String() string
- func (m *AccountHeaderProto) XXX_DiscardUnknown()
- func (m *AccountHeaderProto) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *AccountHeaderProto) XXX_Merge(src proto.Message)
- func (m *AccountHeaderProto) XXX_Size() int
- func (m *AccountHeaderProto) XXX_Unmarshal(b []byte) error
- type Address
- type AddressProto
- func (*AddressProto) Descriptor() ([]byte, []int)
- func (m *AddressProto) GetAddress() []byte
- func (*AddressProto) ProtoMessage()
- func (m *AddressProto) Reset()
- func (m *AddressProto) String() string
- func (m *AddressProto) XXX_DiscardUnknown()
- func (m *AddressProto) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *AddressProto) XXX_Merge(src proto.Message)
- func (m *AddressProto) XXX_Size() int
- func (m *AddressProto) XXX_Unmarshal(b []byte) error
- type Hash
- type HashHeight
- type HashHeightProto
- func (*HashHeightProto) Descriptor() ([]byte, []int)
- func (m *HashHeightProto) GetHash() *HashProto
- func (m *HashHeightProto) GetHeight() uint64
- func (*HashHeightProto) ProtoMessage()
- func (m *HashHeightProto) Reset()
- func (m *HashHeightProto) String() string
- func (m *HashHeightProto) XXX_DiscardUnknown()
- func (m *HashHeightProto) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *HashHeightProto) XXX_Merge(src proto.Message)
- func (m *HashHeightProto) XXX_Size() int
- func (m *HashHeightProto) XXX_Unmarshal(b []byte) error
- type HashProto
- func (*HashProto) Descriptor() ([]byte, []int)
- func (m *HashProto) GetHash() []byte
- func (*HashProto) ProtoMessage()
- func (m *HashProto) Reset()
- func (m *HashProto) String() string
- func (m *HashProto) XXX_DiscardUnknown()
- func (m *HashProto) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *HashProto) XXX_Merge(src proto.Message)
- func (m *HashProto) XXX_Size() int
- func (m *HashProto) XXX_Unmarshal(b []byte) error
- type ImplementedSpork
- type PillarDelegation
- type PillarDelegationDetail
- type SortPDByWeight
- type SortPDDByWeight
- type ZenonTokenStandard
Constants ¶
View Source
const ( AddressPrefix = "z" AddressSize = 1 + AddressCoreSize AddressCoreSize = 19 )
View Source
const ( UserAddrByte = byte(0) ContractAddrByte = byte(1) )
View Source
const ( ZTSPrefix = "zts" ZenonTokenStandardSize = 10 )
View Source
const (
HashSize = 32
)
Variables ¶
View Source
var ( PillarContract = parseEmbedded("z1qxemdeddedxpyllarxxxxxxxxxxxxxxxsy3fmg") PlasmaContract = parseEmbedded("z1qxemdeddedxplasmaxxxxxxxxxxxxxxxxsctrp") StakeContract = parseEmbedded("z1qxemdeddedxstakexxxxxxxxxxxxxxxxjv8v62") SporkContract = parseEmbedded("z1qxemdeddedxsp0rkxxxxxxxxxxxxxxxx956u48") TokenContract = parseEmbedded("z1qxemdeddedxt0kenxxxxxxxxxxxxxxxxh9amk0") SentinelContract = parseEmbedded("z1qxemdeddedxsentynelxxxxxxxxxxxxxwy0r2r") SwapContract = parseEmbedded("z1qxemdeddedxswapxxxxxxxxxxxxxxxxxxl4yww") LiquidityContract = parseEmbedded("z1qxemdeddedxlyquydytyxxxxxxxxxxxxflaaae") AcceleratorContract = parseEmbedded("z1qxemdeddedxaccelerat0rxxxxxxxxxxp4tk22") HtlcContract = parseEmbedded("z1qxemdeddedxhtlcxxxxxxxxxxxxxxxxxygecvw") BridgeContract = parseEmbedded("z1qxemdeddedxdrydgexxxxxxxxxxxxxxxmqgr0d") EmbeddedContracts = []Address{PlasmaContract, PillarContract, TokenContract, SentinelContract, SwapContract, StakeContract, SporkContract, LiquidityContract, AcceleratorContract, HtlcContract, BridgeContract} EmbeddedWUpdate = []Address{PillarContract, StakeContract, SentinelContract, LiquidityContract, AcceleratorContract} SporkAddress *Address )
View Source
var ( AcceleratorSpork = NewImplementedSpork("6d2b1e6cb4025f2f45533f0fe22e9b7ce2014d91cc960471045fa64eee5a6ba3") HtlcSpork = NewImplementedSpork("ceb7e3808ef17ea910adda2f3ab547be4cdfb54de8400ce3683258d06be1354b") BridgeAndLiquiditySpork = NewImplementedSpork("ddd43466769461c5b5d109c639da0f50a7eeb96ad6e7274b1928a35c431d7b1b") ImplementedSporksMap = map[Hash]bool{ AcceleratorSpork.SporkId: true, HtlcSpork.SporkId: true, BridgeAndLiquiditySpork.SporkId: true, } )
View Source
var QsrTokenStandard = ParseZTSPanic("zts1qsrxxxxxxxxxxxxxmrhjll")
View Source
var ZeroAddress = Address{}
View Source
var ZeroHash = Hash{}
View Source
var ZeroHashHeight = HashHeight{ Hash: ZeroHash, Height: 0, }
View Source
var ZeroTokenStandard = ZenonTokenStandard{}
View Source
var ZnnTokenStandard = ParseZTSPanic("zts1znnxxxxxxxxxxxxx9z4ulx")
Functions ¶
func IsEmbeddedAddress ¶
Types ¶
type AccountHeader ¶
type AccountHeader struct { Address Address `json:"address"` HashHeight }
func DeProtoAccountHeader ¶
func DeProtoAccountHeader(pb *AccountHeaderProto) *AccountHeader
func DeserializeAccountHeader ¶
func DeserializeAccountHeader(data []byte) (*AccountHeader, error)
func (*AccountHeader) Bytes ¶
func (abh *AccountHeader) Bytes() []byte
func (*AccountHeader) Identifier ¶
func (abh *AccountHeader) Identifier() HashHeight
func (*AccountHeader) Proto ¶
func (abh *AccountHeader) Proto() *AccountHeaderProto
func (*AccountHeader) Serialize ¶
func (abh *AccountHeader) Serialize() ([]byte, error)
type AccountHeaderProto ¶
type AccountHeaderProto struct { Address *AddressProto `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` HashHeight *HashHeightProto `protobuf:"bytes,2,opt,name=hashHeight,proto3" json:"hashHeight,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*AccountHeaderProto) Descriptor ¶
func (*AccountHeaderProto) Descriptor() ([]byte, []int)
func (*AccountHeaderProto) GetAddress ¶
func (m *AccountHeaderProto) GetAddress() *AddressProto
func (*AccountHeaderProto) GetHashHeight ¶
func (m *AccountHeaderProto) GetHashHeight() *HashHeightProto
func (*AccountHeaderProto) ProtoMessage ¶
func (*AccountHeaderProto) ProtoMessage()
func (*AccountHeaderProto) Reset ¶
func (m *AccountHeaderProto) Reset()
func (*AccountHeaderProto) String ¶
func (m *AccountHeaderProto) String() string
func (*AccountHeaderProto) XXX_DiscardUnknown ¶
func (m *AccountHeaderProto) XXX_DiscardUnknown()
func (*AccountHeaderProto) XXX_Marshal ¶
func (m *AccountHeaderProto) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*AccountHeaderProto) XXX_Merge ¶
func (m *AccountHeaderProto) XXX_Merge(src proto.Message)
func (*AccountHeaderProto) XXX_Size ¶
func (m *AccountHeaderProto) XXX_Size() int
func (*AccountHeaderProto) XXX_Unmarshal ¶
func (m *AccountHeaderProto) XXX_Unmarshal(b []byte) error
type Address ¶
type Address [AddressSize]byte
func BytesToAddress ¶
func DeProtoAddress ¶
func DeProtoAddress(pb *AddressProto) *Address
func ParseAddress ¶
func ParseAddressPanic ¶
func PubKeyToAddress ¶
func (Address) MarshalText ¶
func (*Address) Proto ¶
func (addr *Address) Proto() *AddressProto
func (*Address) UnmarshalText ¶
type AddressProto ¶
type AddressProto struct { Address []byte `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*AddressProto) Descriptor ¶
func (*AddressProto) Descriptor() ([]byte, []int)
func (*AddressProto) GetAddress ¶
func (m *AddressProto) GetAddress() []byte
func (*AddressProto) ProtoMessage ¶
func (*AddressProto) ProtoMessage()
func (*AddressProto) Reset ¶
func (m *AddressProto) Reset()
func (*AddressProto) String ¶
func (m *AddressProto) String() string
func (*AddressProto) XXX_DiscardUnknown ¶
func (m *AddressProto) XXX_DiscardUnknown()
func (*AddressProto) XXX_Marshal ¶
func (m *AddressProto) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*AddressProto) XXX_Merge ¶
func (m *AddressProto) XXX_Merge(src proto.Message)
func (*AddressProto) XXX_Size ¶
func (m *AddressProto) XXX_Size() int
func (*AddressProto) XXX_Unmarshal ¶
func (m *AddressProto) XXX_Unmarshal(b []byte) error
type Hash ¶
func BytesToHash ¶
func BytesToHashPanic ¶
func DeProtoHash ¶
func HexToHashPanic ¶
func (Hash) MarshalText ¶
func (*Hash) UnmarshalText ¶
type HashHeight ¶
func DeProtoHashHeight ¶
func DeProtoHashHeight(pb *HashHeightProto) *HashHeight
func DeserializeHashHeight ¶
func DeserializeHashHeight(data []byte) (*HashHeight, error)
func (*HashHeight) Bytes ¶
func (b *HashHeight) Bytes() []byte
func (HashHeight) IsZero ¶
func (b HashHeight) IsZero() bool
func (*HashHeight) Proto ¶
func (b *HashHeight) Proto() *HashHeightProto
func (*HashHeight) Serialize ¶
func (b *HashHeight) Serialize() []byte
type HashHeightProto ¶
type HashHeightProto struct { Hash *HashProto `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"` Height uint64 `protobuf:"varint,2,opt,name=height,proto3" json:"height,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*HashHeightProto) Descriptor ¶
func (*HashHeightProto) Descriptor() ([]byte, []int)
func (*HashHeightProto) GetHash ¶
func (m *HashHeightProto) GetHash() *HashProto
func (*HashHeightProto) GetHeight ¶
func (m *HashHeightProto) GetHeight() uint64
func (*HashHeightProto) ProtoMessage ¶
func (*HashHeightProto) ProtoMessage()
func (*HashHeightProto) Reset ¶
func (m *HashHeightProto) Reset()
func (*HashHeightProto) String ¶
func (m *HashHeightProto) String() string
func (*HashHeightProto) XXX_DiscardUnknown ¶
func (m *HashHeightProto) XXX_DiscardUnknown()
func (*HashHeightProto) XXX_Marshal ¶
func (m *HashHeightProto) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*HashHeightProto) XXX_Merge ¶
func (m *HashHeightProto) XXX_Merge(src proto.Message)
func (*HashHeightProto) XXX_Size ¶
func (m *HashHeightProto) XXX_Size() int
func (*HashHeightProto) XXX_Unmarshal ¶
func (m *HashHeightProto) XXX_Unmarshal(b []byte) error
type HashProto ¶
type HashProto struct { Hash []byte `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*HashProto) Descriptor ¶
func (*HashProto) ProtoMessage ¶
func (*HashProto) ProtoMessage()
func (*HashProto) XXX_DiscardUnknown ¶
func (m *HashProto) XXX_DiscardUnknown()
func (*HashProto) XXX_Marshal ¶
func (*HashProto) XXX_Unmarshal ¶
type ImplementedSpork ¶
type ImplementedSpork struct {
SporkId Hash
}
func NewImplementedSpork ¶
func NewImplementedSpork(SporkIdStr string) *ImplementedSpork
type PillarDelegation ¶
func ToPillarDelegation ¶
func ToPillarDelegation(details []*PillarDelegationDetail) []*PillarDelegation
ToPillarDelegation converts delegationDetail to delegation to save memory by dropping backers
func (*PillarDelegation) String ¶
func (v *PillarDelegation) String() string
Used for logging purposes
type PillarDelegationDetail ¶
type PillarDelegationDetail struct { PillarDelegation Backers map[Address]*big.Int }
func (*PillarDelegationDetail) Merge ¶
func (pdd *PillarDelegationDetail) Merge(oth *PillarDelegationDetail)
Add all values together into this object
func (*PillarDelegationDetail) Reduce ¶
func (pdd *PillarDelegationDetail) Reduce(count int64)
Reduce all values by dividing them by count
type SortPDByWeight ¶
type SortPDByWeight []*PillarDelegation
func (SortPDByWeight) Len ¶
func (a SortPDByWeight) Len() int
func (SortPDByWeight) Less ¶
func (a SortPDByWeight) Less(i, j int) bool
func (SortPDByWeight) Swap ¶
func (a SortPDByWeight) Swap(i, j int)
type SortPDDByWeight ¶
type SortPDDByWeight []*PillarDelegationDetail
func (SortPDDByWeight) Len ¶
func (a SortPDDByWeight) Len() int
func (SortPDDByWeight) Less ¶
func (a SortPDDByWeight) Less(i, j int) bool
func (SortPDDByWeight) Swap ¶
func (a SortPDDByWeight) Swap(i, j int)
type ZenonTokenStandard ¶
type ZenonTokenStandard [ZenonTokenStandardSize]byte
func BytesToZTS ¶
func BytesToZTS(b []byte) (ZenonTokenStandard, error)
func BytesToZTSPanic ¶
func BytesToZTSPanic(b []byte) ZenonTokenStandard
func NewZenonTokenStandard ¶
func NewZenonTokenStandard(data ...[]byte) ZenonTokenStandard
func ParseZTS ¶
func ParseZTS(ztsString string) (ZenonTokenStandard, error)
func ParseZTSPanic ¶
func ParseZTSPanic(ztsString string) ZenonTokenStandard
func (ZenonTokenStandard) Bytes ¶
func (zts ZenonTokenStandard) Bytes() []byte
func (ZenonTokenStandard) MarshalText ¶
func (zts ZenonTokenStandard) MarshalText() ([]byte, error)
func (*ZenonTokenStandard) SetBytes ¶
func (zts *ZenonTokenStandard) SetBytes(b []byte) error
func (ZenonTokenStandard) String ¶
func (zts ZenonTokenStandard) String() string
func (*ZenonTokenStandard) UnmarshalText ¶
func (zts *ZenonTokenStandard) UnmarshalText(input []byte) error
Click to show internal directories.
Click to hide internal directories.