secpfx

package
v1.23.2 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2026 License: GPL-3.0, LGPL-3.0, LGPL-3.0 Imports: 6 Imported by: 0

Documentation

Overview

Package secpfx wires luxfi/utxo/secp256k1fx into the atomic-tx subsystem behind a small adapter. The upstream Fx machinery requires a host VM that exposes Logger / Clock / CodecRegistry — the registry is luxfi/codec-typed, which would otherwise leak the legacy codec dependency back into plugin/evm/atomic/.

Keeping the glue here lets plugin/evm/atomic/* stay codec-free while preserving the structural Fx integration (semantic verification for atomic transfers).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Adapter

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

Adapter is the lifecycle facade returned by New. It owns the Fx and the no-op registry, and offers exactly the three operations the atomic-tx VM needs to drive the Fx through its lifecycle plus the VerifyTransfer call used in semantic verification.

func New

func New(host Host) (*Adapter, error)

New constructs an Adapter wired to the given host. The fx is initialized eagerly so VerifyTransfer is callable as soon as New returns — atomic-tx accept/verify paths can rely on this.

func (*Adapter) Bootstrapped

func (a *Adapter) Bootstrapped() error

Bootstrapped forwards to the underlying Fx.

func (*Adapter) Bootstrapping

func (a *Adapter) Bootstrapping() error

Bootstrapping forwards to the underlying Fx.

func (*Adapter) CreateOutput

func (a *Adapter) CreateOutput(amount uint64, controlGroup interface{}) (interface{}, error)

CreateOutput forwards to the underlying Fx. Required by the luxfi/proto/p/fx.Fx interface but not exercised by atomic-tx flows.

func (*Adapter) Initialize

func (a *Adapter) Initialize(interface{}) error

Initialize is a no-op — the Adapter already initialized its wrapped Fx in New. It exists so the Adapter satisfies the luxfi/proto/p/fx.Fx interface that downstream verifiers depend on; calling Initialize a second time would re-run secp256k1fx.Fx.Initialize with the host VM reference, which is unsupported.

func (*Adapter) RecoverCache

func (a *Adapter) RecoverCache() secp256k1.RecoverCacheType

RecoverCache exposes the secp256k1 recover cache the host VM stashes next to the Adapter so transaction signature verification can reuse the cache between calls.

func (*Adapter) VerifyPermission

func (a *Adapter) VerifyPermission(tx, in, cred, controlGroup interface{}) error

VerifyPermission forwards to the underlying Fx. Required by the luxfi/proto/p/fx.Fx interface but not exercised by atomic-tx flows.

func (*Adapter) VerifyTransfer

func (a *Adapter) VerifyTransfer(tx, in, cred, utxo interface{}) error

VerifyTransfer is the only Fx call the atomic-tx verifier needs.

type Host

type Host interface {
	Clock() *mockable.Clock
	Logger() log.Logger
}

Host is the small surface the atomic-tx VM provides to the Fx. It matches the runtime-relevant subset of secp256k1fx.VM but lets us add our own registry without dragging luxfi/codec into the VM.

Jump to

Keyboard shortcuts

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