aboutsummaryrefslogtreecommitdiff
path: root/plugin/evm/import_tx_test.go
diff options
context:
space:
mode:
authoraaronbuchwald <aaron.buchwald56@gmail.com>2020-11-09 12:00:29 -0500
committerGitHub <noreply@github.com>2020-11-09 12:00:29 -0500
commit8938754d0d0bc5e1fd7f7a8892b0ff23458c8f10 (patch)
treecd81b89181ac3ecfee082dca202db7db73de3b75 /plugin/evm/import_tx_test.go
parentff462c343e87ba3ab38d7aad95e3a85408f38bb0 (diff)
parent72df173b512eb02306ebcb160b6924cad23cf7af (diff)
Merge pull request #50 from ava-labs/v0.3.12-with-id-update
V0.3.12 with id update
Diffstat (limited to 'plugin/evm/import_tx_test.go')
-rw-r--r--plugin/evm/import_tx_test.go22
1 files changed, 11 insertions, 11 deletions
diff --git a/plugin/evm/import_tx_test.go b/plugin/evm/import_tx_test.go
index fcd18ac..b0f2875 100644
--- a/plugin/evm/import_tx_test.go
+++ b/plugin/evm/import_tx_test.go
@@ -22,7 +22,7 @@ func TestImportTxVerifyNil(t *testing.T) {
func TestImportTxVerify(t *testing.T) {
var importAmount uint64 = 10000000
- txID := ids.NewID([32]byte{0xff})
+ txID := [32]byte{0xff}
importTx := &UnsignedImportTx{
NetworkID: testNetworkID,
BlockchainID: testCChainID,
@@ -77,7 +77,7 @@ func TestImportTxVerify(t *testing.T) {
// Test Valid ImportTx
if err := importTx.Verify(testXChainID, ctx, testTxFee, testAvaxAssetID); err != nil {
- t.Fatalf("Failed to verify ImportTx: %w", err)
+ t.Fatalf("Failed to verify ImportTx: %s", err)
}
importTx.syntacticallyVerified = false
@@ -134,12 +134,12 @@ func TestImportTxSemanticVerify(t *testing.T) {
importAmount := uint64(1000000)
utxoID := avax.UTXOID{
- TxID: ids.NewID([32]byte{
+ TxID: [32]byte{
0x0f, 0x2f, 0x4f, 0x6f, 0x8e, 0xae, 0xce, 0xee,
0x0d, 0x2d, 0x4d, 0x6d, 0x8c, 0xac, 0xcc, 0xec,
0x0b, 0x2b, 0x4b, 0x6b, 0x8a, 0xaa, 0xca, 0xea,
0x09, 0x29, 0x49, 0x69, 0x88, 0xa8, 0xc8, 0xe8,
- }),
+ },
}
utxo := &avax.UTXO{
@@ -203,9 +203,9 @@ func TestImportTxSemanticVerify(t *testing.T) {
if err := unsignedImportTx.SemanticVerify(vm, tx); err != nil {
t.Fatal("Should have failed to import non-existent UTXO")
}
-
+ inputID := utxo.InputID()
if err := xChainSharedMemory.Put(vm.ctx.ChainID, []*atomic.Element{{
- Key: utxo.InputID().Bytes(),
+ Key: inputID[:],
Value: utxoBytes,
Traits: [][]byte{
testKeys[0].PublicKey().Address().Bytes(),
@@ -268,7 +268,7 @@ func TestImportTxSemanticVerify(t *testing.T) {
}
if err := unsignedImportTx.Accept(vm.ctx, nil); err != nil {
- t.Fatalf("Accept failed due to: %w", err)
+ t.Fatalf("Accept failed due to: %s", err)
}
if err := unsignedImportTx.EVMStateTransfer(vm, state); err != nil {
@@ -293,12 +293,12 @@ func TestNewImportTx(t *testing.T) {
importAmount := uint64(1000000)
utxoID := avax.UTXOID{
- TxID: ids.NewID([32]byte{
+ TxID: [32]byte{
0x0f, 0x2f, 0x4f, 0x6f, 0x8e, 0xae, 0xce, 0xee,
0x0d, 0x2d, 0x4d, 0x6d, 0x8c, 0xac, 0xcc, 0xec,
0x0b, 0x2b, 0x4b, 0x6b, 0x8a, 0xaa, 0xca, 0xea,
0x09, 0x29, 0x49, 0x69, 0x88, 0xa8, 0xc8, 0xe8,
- }),
+ },
}
utxo := &avax.UTXO{
@@ -318,9 +318,9 @@ func TestNewImportTx(t *testing.T) {
}
xChainSharedMemory := sharedMemory.NewSharedMemory(vm.ctx.XChainID)
-
+ inputID := utxo.InputID()
if err := xChainSharedMemory.Put(vm.ctx.ChainID, []*atomic.Element{{
- Key: utxo.InputID().Bytes(),
+ Key: inputID[:],
Value: utxoBytes,
Traits: [][]byte{
testKeys[0].PublicKey().Address().Bytes(),