From 40879ea67433b73b464bd8b012a9809fbb646cfd Mon Sep 17 00:00:00 2001 From: Determinant Date: Wed, 19 Aug 2020 23:34:12 -0400 Subject: WIP: C-to-X transfer --- plugin/evm/tx.go | 37 +++++++++---------------------------- 1 file changed, 9 insertions(+), 28 deletions(-) (limited to 'plugin/evm/tx.go') 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) -- cgit v1.2.3-70-g09d2