Files
zeekay 7cf87b230b node-unified is the node
The module already called itself github.com/luxfi/node while containing no node
in Go: cmd/luxd was twenty-one lines that printed the size of a few types, and
the Go column of the matrix measured a VM plugin. A repo that fetches the thing
it claims to be has not replaced it, so the Go sources move in — 1515 files,
the daemon and everything under it — and the build reaches outside this module
for nothing.

Rust and C++ sit beside it unchanged and are still measured against it by the
differential. That is the point of one repo: the reference implementation and
the two ports are the same checkout, so parity is a thing you can run rather
than a thing you assert.

Verified: builds, and the closure carries no lux-private — checked at build time
rather than believed. The daemon starts twelve chains on a local network
(P X C Q Z A B G K M F, plus D through its plugin) and reports healthy.
2026-09-07 16:15:25 -07:00

451 lines
12 KiB
Go

// Code generated by zip; DO NOT EDIT.
package indexer
import (
"encoding/binary"
"fmt"
"strings"
formatting "github.com/luxfi/formatting"
json "github.com/luxfi/node/utils/json"
zap "github.com/zap-proto/go"
)
// ---- FormattedContainer ------------------------------------------------
const (
formattedContainerIDAt = 0
formattedContainerBytesAt = 32
formattedContainerTimestampAt = 40
formattedContainerEncodingAt = 48
formattedContainerIndexAt = 56
formattedContainerSize = 64
)
var _ interface {
MarshalZAP() ([]byte, error)
UnmarshalZAP([]byte) error
} = (*FormattedContainer)(nil)
// MarshalZAP writes FormattedContainer from constant offsets.
func (x *FormattedContainer) MarshalZAP() ([]byte, error) {
if x == nil {
return nil, nil
}
b := zap.NewBuilder(formattedContainerSize + 256)
ob := b.StartObject(formattedContainerSize)
ob.SetBytesFixed(formattedContainerIDAt, x.ID[:])
ob.SetText(formattedContainerBytesAt, string(x.Bytes))
innerTimestamp, err := x.Timestamp.MarshalZAP()
if err != nil {
return nil, err
}
ob.SetBytes(formattedContainerTimestampAt, innerTimestamp)
ob.SetUint8(formattedContainerEncodingAt, uint8(x.Encoding))
ob.SetUint64(formattedContainerIndexAt, uint64(x.Index))
ob.FinishAsRoot()
return b.Finish(), nil
}
// UnmarshalZAP reads FormattedContainer out of the buffer that arrived.
func (x *FormattedContainer) UnmarshalZAP(data []byte) error {
if x == nil || len(data) == 0 {
return nil
}
m, err := zap.Parse(data)
if err != nil {
return fmt.Errorf("FormattedContainer: %w", err)
}
o := m.Root()
copy(x.ID[:], o.BytesFixed(formattedContainerIDAt, 32))
x.Bytes = string(strings.Clone(o.Text(formattedContainerBytesAt)))
if raw := o.Bytes(formattedContainerTimestampAt); len(raw) > 0 {
if err := x.Timestamp.UnmarshalZAP(raw); err != nil {
return err
}
}
x.Encoding = formatting.Encoding(o.Uint8(formattedContainerEncodingAt))
x.Index = json.Uint64(o.Uint64(formattedContainerIndexAt))
return nil
}
// ---- GetContainerByIDArgs ----------------------------------------------
const (
getContainerByIDArgsIDAt = 0
getContainerByIDArgsEncodingAt = 32
getContainerByIDArgsSize = 40
)
var _ interface {
MarshalZAP() ([]byte, error)
UnmarshalZAP([]byte) error
} = (*GetContainerByIDArgs)(nil)
// MarshalZAP writes GetContainerByIDArgs from constant offsets.
func (x *GetContainerByIDArgs) MarshalZAP() ([]byte, error) {
if x == nil {
return nil, nil
}
b := zap.NewBuilder(getContainerByIDArgsSize + 256)
ob := b.StartObject(getContainerByIDArgsSize)
ob.SetBytesFixed(getContainerByIDArgsIDAt, x.ID[:])
ob.SetUint8(getContainerByIDArgsEncodingAt, uint8(x.Encoding))
ob.FinishAsRoot()
return b.Finish(), nil
}
// UnmarshalZAP reads GetContainerByIDArgs out of the buffer that arrived.
func (x *GetContainerByIDArgs) UnmarshalZAP(data []byte) error {
if x == nil || len(data) == 0 {
return nil
}
m, err := zap.Parse(data)
if err != nil {
return fmt.Errorf("GetContainerByIDArgs: %w", err)
}
o := m.Root()
copy(x.ID[:], o.BytesFixed(getContainerByIDArgsIDAt, 32))
x.Encoding = formatting.Encoding(o.Uint8(getContainerByIDArgsEncodingAt))
return nil
}
// ---- GetContainerByIndexArgs -------------------------------------------
const (
getContainerByIndexArgsIndexAt = 0
getContainerByIndexArgsEncodingAt = 8
getContainerByIndexArgsSize = 16
)
var _ interface {
MarshalZAP() ([]byte, error)
UnmarshalZAP([]byte) error
} = (*GetContainerByIndexArgs)(nil)
// MarshalZAP writes GetContainerByIndexArgs from constant offsets.
func (x *GetContainerByIndexArgs) MarshalZAP() ([]byte, error) {
if x == nil {
return nil, nil
}
b := zap.NewBuilder(getContainerByIndexArgsSize + 256)
ob := b.StartObject(getContainerByIndexArgsSize)
ob.SetUint64(getContainerByIndexArgsIndexAt, uint64(x.Index))
ob.SetUint8(getContainerByIndexArgsEncodingAt, uint8(x.Encoding))
ob.FinishAsRoot()
return b.Finish(), nil
}
// UnmarshalZAP reads GetContainerByIndexArgs out of the buffer that arrived.
func (x *GetContainerByIndexArgs) UnmarshalZAP(data []byte) error {
if x == nil || len(data) == 0 {
return nil
}
m, err := zap.Parse(data)
if err != nil {
return fmt.Errorf("GetContainerByIndexArgs: %w", err)
}
o := m.Root()
x.Index = json.Uint64(o.Uint64(getContainerByIndexArgsIndexAt))
x.Encoding = formatting.Encoding(o.Uint8(getContainerByIndexArgsEncodingAt))
return nil
}
// ---- GetContainerRangeArgs ---------------------------------------------
const (
getContainerRangeArgsStartIndexAt = 0
getContainerRangeArgsNumToFetchAt = 8
getContainerRangeArgsEncodingAt = 16
getContainerRangeArgsSize = 24
)
var _ interface {
MarshalZAP() ([]byte, error)
UnmarshalZAP([]byte) error
} = (*GetContainerRangeArgs)(nil)
// MarshalZAP writes GetContainerRangeArgs from constant offsets.
func (x *GetContainerRangeArgs) MarshalZAP() ([]byte, error) {
if x == nil {
return nil, nil
}
b := zap.NewBuilder(getContainerRangeArgsSize + 256)
ob := b.StartObject(getContainerRangeArgsSize)
ob.SetUint64(getContainerRangeArgsStartIndexAt, uint64(x.StartIndex))
ob.SetUint64(getContainerRangeArgsNumToFetchAt, uint64(x.NumToFetch))
ob.SetUint8(getContainerRangeArgsEncodingAt, uint8(x.Encoding))
ob.FinishAsRoot()
return b.Finish(), nil
}
// UnmarshalZAP reads GetContainerRangeArgs out of the buffer that arrived.
func (x *GetContainerRangeArgs) UnmarshalZAP(data []byte) error {
if x == nil || len(data) == 0 {
return nil
}
m, err := zap.Parse(data)
if err != nil {
return fmt.Errorf("GetContainerRangeArgs: %w", err)
}
o := m.Root()
x.StartIndex = json.Uint64(o.Uint64(getContainerRangeArgsStartIndexAt))
x.NumToFetch = json.Uint64(o.Uint64(getContainerRangeArgsNumToFetchAt))
x.Encoding = formatting.Encoding(o.Uint8(getContainerRangeArgsEncodingAt))
return nil
}
// ---- GetContainerRangeResponse -----------------------------------------
const (
getContainerRangeResponseContainersAt = 0
getContainerRangeResponseSize = 8
)
var _ interface {
MarshalZAP() ([]byte, error)
UnmarshalZAP([]byte) error
} = (*GetContainerRangeResponse)(nil)
// MarshalZAP writes GetContainerRangeResponse from constant offsets.
func (x *GetContainerRangeResponse) MarshalZAP() ([]byte, error) {
if x == nil {
return nil, nil
}
b := zap.NewBuilder(getContainerRangeResponseSize + 256)
containersAt, containersN := 0, len(x.Containers)
if containersN > 0 {
var blob []byte
for i := range x.Containers {
enc, err := x.Containers[i].MarshalZAP()
if err != nil {
return nil, err
}
var n [4]byte
binary.LittleEndian.PutUint32(n[:], uint32(len(enc)))
blob = append(blob, n[:]...)
blob = append(blob, enc...)
}
containersAt = b.WriteBytes(blob)
}
ob := b.StartObject(getContainerRangeResponseSize)
if containersN > 0 {
ob.SetList(getContainerRangeResponseContainersAt, containersAt, containersN)
}
ob.FinishAsRoot()
return b.Finish(), nil
}
// UnmarshalZAP reads GetContainerRangeResponse out of the buffer that arrived.
func (x *GetContainerRangeResponse) UnmarshalZAP(data []byte) error {
if x == nil || len(data) == 0 {
return nil
}
m, err := zap.Parse(data)
if err != nil {
return fmt.Errorf("GetContainerRangeResponse: %w", err)
}
o := m.Root()
if l := o.List(getContainerRangeResponseContainersAt); l.Len() > 0 {
rows := make([]FormattedContainer, l.Len())
for i := range rows {
if err := rows[i].UnmarshalZAP(l.BytesAt(i)); err != nil {
return err
}
}
x.Containers = rows
}
return nil
}
// ---- GetIndexArgs ------------------------------------------------------
const (
getIndexArgsIDAt = 0
getIndexArgsSize = 32
)
var _ interface {
MarshalZAP() ([]byte, error)
UnmarshalZAP([]byte) error
} = (*GetIndexArgs)(nil)
// MarshalZAP writes GetIndexArgs from constant offsets.
func (x *GetIndexArgs) MarshalZAP() ([]byte, error) {
if x == nil {
return nil, nil
}
b := zap.NewBuilder(getIndexArgsSize + 256)
ob := b.StartObject(getIndexArgsSize)
ob.SetBytesFixed(getIndexArgsIDAt, x.ID[:])
ob.FinishAsRoot()
return b.Finish(), nil
}
// UnmarshalZAP reads GetIndexArgs out of the buffer that arrived.
func (x *GetIndexArgs) UnmarshalZAP(data []byte) error {
if x == nil || len(data) == 0 {
return nil
}
m, err := zap.Parse(data)
if err != nil {
return fmt.Errorf("GetIndexArgs: %w", err)
}
o := m.Root()
copy(x.ID[:], o.BytesFixed(getIndexArgsIDAt, 32))
return nil
}
// ---- GetIndexResponse --------------------------------------------------
const (
getIndexResponseIndexAt = 0
getIndexResponseSize = 8
)
var _ interface {
MarshalZAP() ([]byte, error)
UnmarshalZAP([]byte) error
} = (*GetIndexResponse)(nil)
// MarshalZAP writes GetIndexResponse from constant offsets.
func (x *GetIndexResponse) MarshalZAP() ([]byte, error) {
if x == nil {
return nil, nil
}
b := zap.NewBuilder(getIndexResponseSize + 256)
ob := b.StartObject(getIndexResponseSize)
ob.SetUint64(getIndexResponseIndexAt, uint64(x.Index))
ob.FinishAsRoot()
return b.Finish(), nil
}
// UnmarshalZAP reads GetIndexResponse out of the buffer that arrived.
func (x *GetIndexResponse) UnmarshalZAP(data []byte) error {
if x == nil || len(data) == 0 {
return nil
}
m, err := zap.Parse(data)
if err != nil {
return fmt.Errorf("GetIndexResponse: %w", err)
}
o := m.Root()
x.Index = json.Uint64(o.Uint64(getIndexResponseIndexAt))
return nil
}
// ---- GetLastAcceptedArgs -----------------------------------------------
const (
getLastAcceptedArgsEncodingAt = 0
getLastAcceptedArgsSize = 8
)
var _ interface {
MarshalZAP() ([]byte, error)
UnmarshalZAP([]byte) error
} = (*GetLastAcceptedArgs)(nil)
// MarshalZAP writes GetLastAcceptedArgs from constant offsets.
func (x *GetLastAcceptedArgs) MarshalZAP() ([]byte, error) {
if x == nil {
return nil, nil
}
b := zap.NewBuilder(getLastAcceptedArgsSize + 256)
ob := b.StartObject(getLastAcceptedArgsSize)
ob.SetUint8(getLastAcceptedArgsEncodingAt, uint8(x.Encoding))
ob.FinishAsRoot()
return b.Finish(), nil
}
// UnmarshalZAP reads GetLastAcceptedArgs out of the buffer that arrived.
func (x *GetLastAcceptedArgs) UnmarshalZAP(data []byte) error {
if x == nil || len(data) == 0 {
return nil
}
m, err := zap.Parse(data)
if err != nil {
return fmt.Errorf("GetLastAcceptedArgs: %w", err)
}
o := m.Root()
x.Encoding = formatting.Encoding(o.Uint8(getLastAcceptedArgsEncodingAt))
return nil
}
// ---- IsAcceptedArgs ----------------------------------------------------
const (
isAcceptedArgsIDAt = 0
isAcceptedArgsSize = 32
)
var _ interface {
MarshalZAP() ([]byte, error)
UnmarshalZAP([]byte) error
} = (*IsAcceptedArgs)(nil)
// MarshalZAP writes IsAcceptedArgs from constant offsets.
func (x *IsAcceptedArgs) MarshalZAP() ([]byte, error) {
if x == nil {
return nil, nil
}
b := zap.NewBuilder(isAcceptedArgsSize + 256)
ob := b.StartObject(isAcceptedArgsSize)
ob.SetBytesFixed(isAcceptedArgsIDAt, x.ID[:])
ob.FinishAsRoot()
return b.Finish(), nil
}
// UnmarshalZAP reads IsAcceptedArgs out of the buffer that arrived.
func (x *IsAcceptedArgs) UnmarshalZAP(data []byte) error {
if x == nil || len(data) == 0 {
return nil
}
m, err := zap.Parse(data)
if err != nil {
return fmt.Errorf("IsAcceptedArgs: %w", err)
}
o := m.Root()
copy(x.ID[:], o.BytesFixed(isAcceptedArgsIDAt, 32))
return nil
}
// ---- IsAcceptedResponse ------------------------------------------------
const (
isAcceptedResponseIsAcceptedAt = 0
isAcceptedResponseSize = 8
)
var _ interface {
MarshalZAP() ([]byte, error)
UnmarshalZAP([]byte) error
} = (*IsAcceptedResponse)(nil)
// MarshalZAP writes IsAcceptedResponse from constant offsets.
func (x *IsAcceptedResponse) MarshalZAP() ([]byte, error) {
if x == nil {
return nil, nil
}
b := zap.NewBuilder(isAcceptedResponseSize + 256)
ob := b.StartObject(isAcceptedResponseSize)
ob.SetBool(isAcceptedResponseIsAcceptedAt, bool(x.IsAccepted))
ob.FinishAsRoot()
return b.Finish(), nil
}
// UnmarshalZAP reads IsAcceptedResponse out of the buffer that arrived.
func (x *IsAcceptedResponse) UnmarshalZAP(data []byte) error {
if x == nil || len(data) == 0 {
return nil
}
m, err := zap.Parse(data)
if err != nil {
return fmt.Errorf("IsAcceptedResponse: %w", err)
}
o := m.Root()
x.IsAccepted = bool(o.Bool(isAcceptedResponseIsAcceptedAt))
return nil
}