diff options
author | Determinant <[email protected]> | 2020-08-19 23:34:12 -0400 |
---|---|---|
committer | Determinant <[email protected]> | 2020-08-19 23:34:12 -0400 |
commit | 40879ea67433b73b464bd8b012a9809fbb646cfd (patch) | |
tree | a11646c8f69a217c936322bd937915b2ecc7bdba /plugin/evm/tx.go | |
parent | 0b934ef60fd652de038a21e6f25691b11cea7121 (diff) |
WIP: C-to-X transfer
Diffstat (limited to 'plugin/evm/tx.go')
-rw-r--r-- | plugin/evm/tx.go | 37 |
1 files changed, 9 insertions, 28 deletions
diff --git a/plugin/evm/tx.go b/plugin/evm/tx.go index 6196eb8..90cd232 100644 --- a/plugin/evm/tx.go +++ b/plugin/evm/tx.go @@ -8,7 +8,6 @@ import ( "fmt" "github.com/ava-labs/gecko/database" - "github.com/ava-labs/gecko/database/versiondb" "github.com/ava-labs/gecko/ids" "github.com/ava-labs/gecko/snow" "github.com/ava-labs/gecko/utils/codec" @@ -38,6 +37,12 @@ func (out *EVMOutput) Verify() error { return nil } +type EVMInput EVMOutput + +func (in *EVMInput) Verify() error { + return nil +} + // UnsignedTx is an unsigned transaction type UnsignedTx interface { Initialize(unsignedBytes, signedBytes []byte) @@ -46,32 +51,6 @@ type UnsignedTx interface { Bytes() []byte } -// UnsignedDecisionTx is an unsigned operation that can be immediately decided -type UnsignedDecisionTx interface { - UnsignedTx - - // Attempts to verify this transaction with the provided state. - SemanticVerify(vm *VM, db database.Database, stx *Tx) ( - onAcceptFunc func() error, - err TxError, - ) -} - -// UnsignedProposalTx is an unsigned operation that can be proposed -type UnsignedProposalTx interface { - UnsignedTx - - // Attempts to verify this transaction with the provided state. - SemanticVerify(vm *VM, db database.Database, stx *Tx) ( - onCommitDB *versiondb.Database, - onAbortDB *versiondb.Database, - onCommitFunc func() error, - onAbortFunc func() error, - err TxError, - ) - InitiallyPrefersCommit(vm *VM) bool -} - // UnsignedAtomicTx is an unsigned operation that can be atomically accepted type UnsignedAtomicTx interface { UnsignedTx @@ -79,7 +58,7 @@ type UnsignedAtomicTx interface { // UTXOs this tx consumes InputUTXOs() ids.Set // Attempts to verify this transaction with the provided state. - SemanticVerify(vm *VM, db database.Database, stx *Tx) TxError + SemanticVerify(vm *VM, stx *Tx) TxError // Accept this transaction with the additionally provided state transitions. Accept(ctx *snow.Context, batch database.Batch) error @@ -94,6 +73,8 @@ type Tx struct { Creds []verify.Verifiable `serialize:"true" json:"credentials"` } +// (*secp256k1fx.Credential) + // Sign this transaction with the provided signers func (tx *Tx) Sign(c codec.Codec, signers [][]*crypto.PrivateKeySECP256K1R) error { unsignedBytes, err := c.Marshal(&tx.UnsignedTx) |