2020-03-10 12:20:34 -07:00
|
|
|
// (c) 2019-2020, Ava Labs, Inc. All rights reserved.
|
|
|
|
// See the file LICENSE for licensing terms.
|
|
|
|
|
|
|
|
package avm
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/ava-labs/gecko/ids"
|
2020-03-29 22:08:45 -07:00
|
|
|
"github.com/ava-labs/gecko/vms/components/verify"
|
2020-03-10 12:20:34 -07:00
|
|
|
)
|
|
|
|
|
|
|
|
type parsedFx struct {
|
|
|
|
ID ids.ID
|
|
|
|
Fx Fx
|
|
|
|
}
|
|
|
|
|
|
|
|
// Fx is the interface a feature extension must implement to support the AVM.
|
|
|
|
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
|
|
|
|
|
2020-06-02 14:01:51 -07:00
|
|
|
// Notify this Fx that the VM is in bootstrapping
|
|
|
|
Bootstrapping() error
|
|
|
|
|
|
|
|
// Notify this Fx that the VM is bootstrapped
|
|
|
|
Bootstrapped() error
|
|
|
|
|
2020-03-10 12:20:34 -07:00
|
|
|
// 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.
|
2020-03-29 22:08:45 -07:00
|
|
|
VerifyTransfer(tx, in, cred, utxo interface{}) error
|
2020-03-10 12:20:34 -07:00
|
|
|
|
|
|
|
// VerifyOperation verifies that the specified transaction can spend the
|
|
|
|
// provided utxos conditioned on the result being restricted to the provided
|
|
|
|
// outputs. If the transaction can't spend the output based on the input and
|
|
|
|
// credential, a non-nil error should be returned.
|
2020-03-29 22:08:45 -07:00
|
|
|
VerifyOperation(tx, op, cred interface{}, utxos []interface{}) error
|
|
|
|
}
|
|
|
|
|
|
|
|
// FxOperation ...
|
|
|
|
type FxOperation interface {
|
|
|
|
verify.Verifiable
|
|
|
|
|
|
|
|
Outs() []verify.Verifiable
|
2020-03-10 12:20:34 -07:00
|
|
|
}
|