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

68 lines
2.1 KiB
Go

// Copyright (C) 2019-2025, Lux Industries Inc. All rights reserved.
// See the file LICENSE for licensing terms.
package fx
import (
"github.com/luxfi/node/vms/components/verify"
"github.com/luxfi/utxo/secp256k1fx"
)
var (
_ Fx = (*secp256k1fx.Fx)(nil)
// Note: secp256k1fx.OutputOwners may not implement Owner directly
// _ Owner = (*secp256k1fx.OutputOwners)(nil)
_ Owned = (*secp256k1fx.TransferOutput)(nil)
)
// OutputOwnersWrapper wraps secp256k1fx.OutputOwners to implement Owner
type OutputOwnersWrapper struct {
*secp256k1fx.OutputOwners
}
var _ Owner = (*OutputOwnersWrapper)(nil)
// Fx is the interface a feature extension must implement to support the
// Platform Chain.
type Fx interface {
// Initialize this feature extension to be running under this VM. Should
// return an error if the VM is incompatible.
Initialize(vm interface{}) error
// Notify this Fx that the VM is in bootstrapping
Bootstrapping() error
// Notify this Fx that the VM is bootstrapped
Bootstrapped() error
// VerifyTransfer verifies that the specified transaction can spend the
// provided utxo with no restrictions on the destination. If the transaction
// can't spend the output based on the input and credential, a non-nil error
// should be returned.
VerifyTransfer(tx, in, cred, utxo interface{}) error
// VerifyPermission returns nil iff [cred] proves that [controlGroup]
// assents to [tx]
VerifyPermission(tx, in, cred, controlGroup interface{}) error
// VerifyOperation verifies that [tx] can perform [op] against [utxos]
// using [cred] for authorisation. Mirrors the XVM contract — the
// concrete secp256k1fx.Fx satisfies both interfaces identically, so the
// same per-Op authorisation logic protects P-Chain assets.
VerifyOperation(tx, op, cred interface{}, utxos []interface{}) error
// CreateOutput creates a new output with the provided control group worth
// the specified amount
CreateOutput(amount uint64, controlGroup interface{}) (interface{}, error)
}
type Owner interface {
verify.IsNotState
verify.Verifiable
}
type Owned interface {
Owners() interface{}
}