feat: add InitRuntime forwarder on TransferableInput

Required by node consumers (platformvm, xvm) that delegate a runtime
context down to feature-extension input types. No-op for inputs that
do not implement the runtime-aware interface.

Brings parity with the in-tree node/vms/components/lux/transferables.go
that this package supersedes.
This commit is contained in:
Hanzo AI
2026-04-13 06:48:31 -07:00
parent 566a3f4fed
commit f84a291c6a
+9
View File
@@ -163,6 +163,15 @@ func (in *TransferableInput) Compare(other *TransferableInput) int {
return in.UTXOID.Compare(&other.UTXOID)
}
// InitRuntime forwards the runtime to the inner Fx input if it implements
// the runtime-aware interface. No-op otherwise. Used by VMs that need to
// hand a runtime context down to feature-extension input types.
func (in *TransferableInput) InitRuntime(rt *runtime.Runtime) {
if contextInput, ok := in.In.(interface{ InitRuntime(*runtime.Runtime) }); ok {
contextInput.InitRuntime(rt)
}
}
type innerSortTransferableInputsWithSigners struct {
ins []*TransferableInput
signers [][]*secp256k1.PrivateKey