mirror of
https://github.com/luxfi/utxo.git
synced 2026-07-27 03:39:23 +00:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user