diff --git a/chain/dependencies.go b/chain/dependencies.go index 902cff7fae..bb65b56512 100644 --- a/chain/dependencies.go +++ b/chain/dependencies.go @@ -231,6 +231,10 @@ type Object interface { type Action interface { Object + // GetActionID returns the ActionID for an [Action] in a [Transaction]. There may be + // multiple [Action]s, so we pass its index in the [Action] array along with the txID. + GetActionID(idx uint8, txID ids.ID) codec.Address + // MaxComputeUnits is the maximum amount of compute a given [Action] could use. This is // used to determine whether the [Action] can be included in a given block and to compute // the required fee to execute. diff --git a/examples/morpheusvm/actions/transfer.go b/examples/morpheusvm/actions/transfer.go index 24e00514bc..ddd3775c99 100644 --- a/examples/morpheusvm/actions/transfer.go +++ b/examples/morpheusvm/actions/transfer.go @@ -31,6 +31,10 @@ func (*Transfer) GetTypeID() uint8 { return mconsts.TransferID } +func (*BurnAsset) GetActionID(idx uint8, txID ids.ID) codec.Address { + return codec.CreateAddress(idx, txID) +} + func (t *Transfer) StateKeys(actor codec.Address, _ ids.ID) state.Keys { return state.Keys{ string(storage.BalanceKey(actor)): state.Read | state.Write,