From 9af233bd106fb45307a75876c7f1985f5a7f10ec Mon Sep 17 00:00:00 2001 From: Nazaret Garcia Date: Thu, 5 Dec 2024 18:52:44 -0300 Subject: [PATCH] Removing comments --- .../java/co/rsk/vm/opcode/MCopyDslTest.java | 162 +++--------------- 1 file changed, 28 insertions(+), 134 deletions(-) diff --git a/rskj-core/src/test/java/co/rsk/vm/opcode/MCopyDslTest.java b/rskj-core/src/test/java/co/rsk/vm/opcode/MCopyDslTest.java index 0c5695de79..fec4e253cb 100644 --- a/rskj-core/src/test/java/co/rsk/vm/opcode/MCopyDslTest.java +++ b/rskj-core/src/test/java/co/rsk/vm/opcode/MCopyDslTest.java @@ -35,39 +35,31 @@ void testMCOPY_whenNotActivated_behavesAsExpected() throws FileNotFoundException // Assertions - // There's one block (b01) containing only 1 transaction Block block1 = world.getBlockByName("b01"); Assertions.assertNotNull(block1); Assertions.assertEquals(1, block1.getTransactionsList().size()); - // There's a transaction called txTestMCopy Transaction txTestMCopy = world.getTransactionByName("txTestMCopy"); Assertions.assertNotNull(txTestMCopy); - // Transaction txTestMCopy has a transaction receipt TransactionReceipt txTestMCopyReceipt = world.getTransactionReceiptByName("txTestMCopy"); Assertions.assertNotNull(txTestMCopyReceipt); - // Transaction txTestMCopy has been processed correctly byte[] creationStatus = txTestMCopyReceipt.getStatus(); Assertions.assertNotNull(creationStatus); Assertions.assertEquals(1, creationStatus.length); Assertions.assertEquals(1, creationStatus[0]); - // There's one block (b02) containing only 1 transaction Block block2 = world.getBlockByName("b02"); Assertions.assertNotNull(block2); Assertions.assertEquals(1, block2.getTransactionsList().size()); - // There's a transaction called txTestMCopyNotActivated Transaction txTestMCopyNotActivated = world.getTransactionByName("txTestMCopyNotActivated"); Assertions.assertNotNull(txTestMCopyNotActivated); - // Transaction txTestMCopyNotActivated has a transaction receipt TransactionReceipt txTestMCopyNotActivatedReceipt = world.getTransactionReceiptByName("txTestMCopyNotActivated"); Assertions.assertNotNull(txTestMCopyNotActivatedReceipt); - // Transaction txTestMCopyNotActivated has failed byte[] txTestMCopyNotActivatedCreationStatus = txTestMCopyNotActivatedReceipt.getStatus(); Assertions.assertNotNull(txTestMCopyNotActivatedCreationStatus); Assertions.assertEquals(0, txTestMCopyNotActivatedCreationStatus.length); @@ -84,45 +76,38 @@ void testMCOPY_testCase1_behavesAsExpected() throws FileNotFoundException, DslPr // Assertions - // There's one block (b01) containing only 1 transaction Block block1 = world.getBlockByName("b01"); Assertions.assertNotNull(block1); Assertions.assertEquals(1, block1.getTransactionsList().size()); - // There's a transaction called txTestMCopy Transaction txTestMCopy = world.getTransactionByName("txTestMCopy"); Assertions.assertNotNull(txTestMCopy); - // Transaction txTestMCopy has a transaction receipt TransactionReceipt txTestMCopyReceipt = world.getTransactionReceiptByName("txTestMCopy"); Assertions.assertNotNull(txTestMCopyReceipt); - // Transaction txTestMCopy has been processed correctly byte[] creationStatus = txTestMCopyReceipt.getStatus(); Assertions.assertNotNull(creationStatus); Assertions.assertEquals(1, creationStatus.length); Assertions.assertEquals(1, creationStatus[0]); - // There's one block (b02) containing only 1 transaction Block block2 = world.getBlockByName("b02"); Assertions.assertNotNull(block2); Assertions.assertEquals(1, block2.getTransactionsList().size()); - // There's a transaction called txTestMCopyOKCall Transaction txTestMCopyOKCall = world.getTransactionByName("txTestMCopyOKCall"); Assertions.assertNotNull(txTestMCopyOKCall); - // Transaction txTestMCopyOKCall has a transaction receipt TransactionReceipt txTestMCopyOKCallReceipt = world.getTransactionReceiptByName("txTestMCopyOKCall"); Assertions.assertNotNull(txTestMCopyOKCallReceipt); - // Transaction txTestMCopyOKCall has been processed correctly byte[] txTestMCopyOKCallCreationStatus = txTestMCopyOKCallReceipt.getStatus(); Assertions.assertNotNull(txTestMCopyOKCallCreationStatus); Assertions.assertEquals(1, txTestMCopyOKCallCreationStatus.length); Assertions.assertEquals(1, txTestMCopyOKCallCreationStatus[0]); - // Check events + // Event Assertions + Assertions.assertEquals(1, TransactionReceiptUtil.getEventCount(txTestMCopyOKCallReceipt, "OK", null)); Assertions.assertEquals(0, TransactionReceiptUtil.getEventCount(txTestMCopyOKCallReceipt, "ERROR", null)); @@ -138,45 +123,38 @@ void testMCOPY_testCase2_behavesAsExpected() throws FileNotFoundException, DslPr // Assertions - // There's one block (b01) containing only 1 transaction Block block1 = world.getBlockByName("b01"); Assertions.assertNotNull(block1); Assertions.assertEquals(1, block1.getTransactionsList().size()); - // There's a transaction called txTestMCopy Transaction txTestMCopy = world.getTransactionByName("txTestMCopy"); Assertions.assertNotNull(txTestMCopy); - // Transaction txTestMCopy has a transaction receipt TransactionReceipt txTestMCopyReceipt = world.getTransactionReceiptByName("txTestMCopy"); Assertions.assertNotNull(txTestMCopyReceipt); - // Transaction txTestMCopy has been processed correctly byte[] creationStatus = txTestMCopyReceipt.getStatus(); Assertions.assertNotNull(creationStatus); Assertions.assertEquals(1, creationStatus.length); Assertions.assertEquals(1, creationStatus[0]); - // There's one block (b02) containing only 1 transaction Block block2 = world.getBlockByName("b02"); Assertions.assertNotNull(block2); Assertions.assertEquals(1, block2.getTransactionsList().size()); - // There's a transaction called txTestMCopyOKCall Transaction txTestMCopyOKCall = world.getTransactionByName("txTestMCopyOKCall"); Assertions.assertNotNull(txTestMCopyOKCall); - // Transaction txTestMCopyOKCall has a transaction receipt TransactionReceipt txTestMCopyOKCallReceipt = world.getTransactionReceiptByName("txTestMCopyOKCall"); Assertions.assertNotNull(txTestMCopyOKCallReceipt); - // Transaction txTestMCopyOKCall has been processed correctly byte[] txTestMCopyOKCallCreationStatus = txTestMCopyOKCallReceipt.getStatus(); Assertions.assertNotNull(txTestMCopyOKCallCreationStatus); Assertions.assertEquals(1, txTestMCopyOKCallCreationStatus.length); Assertions.assertEquals(1, txTestMCopyOKCallCreationStatus[0]); - // Check events + // Event Assertions + Assertions.assertEquals(1, TransactionReceiptUtil.getEventCount(txTestMCopyOKCallReceipt, "OK", null)); Assertions.assertEquals(0, TransactionReceiptUtil.getEventCount(txTestMCopyOKCallReceipt, "ERROR", null)); @@ -192,45 +170,38 @@ void testMCOPY_testCase3_behavesAsExpected() throws FileNotFoundException, DslPr // Assertions - // There's one block (b01) containing only 1 transaction Block block1 = world.getBlockByName("b01"); Assertions.assertNotNull(block1); Assertions.assertEquals(1, block1.getTransactionsList().size()); - // There's a transaction called txTestMCopy Transaction txTestMCopy = world.getTransactionByName("txTestMCopy"); Assertions.assertNotNull(txTestMCopy); - // Transaction txTestMCopy has a transaction receipt TransactionReceipt txTestMCopyReceipt = world.getTransactionReceiptByName("txTestMCopy"); Assertions.assertNotNull(txTestMCopyReceipt); - // Transaction txTestMCopy has been processed correctly byte[] creationStatus = txTestMCopyReceipt.getStatus(); Assertions.assertNotNull(creationStatus); Assertions.assertEquals(1, creationStatus.length); Assertions.assertEquals(1, creationStatus[0]); - // There's one block (b02) containing only 1 transaction Block block2 = world.getBlockByName("b02"); Assertions.assertNotNull(block2); Assertions.assertEquals(1, block2.getTransactionsList().size()); - // There's a transaction called txTestMCopyOKCall Transaction txTestMCopyOKCall = world.getTransactionByName("txTestMCopyOKCall"); Assertions.assertNotNull(txTestMCopyOKCall); - // Transaction txTestMCopyOKCall has a transaction receipt TransactionReceipt txTestMCopyOKCallReceipt = world.getTransactionReceiptByName("txTestMCopyOKCall"); Assertions.assertNotNull(txTestMCopyOKCallReceipt); - // Transaction txTestMCopyOKCall has been processed correctly byte[] txTestMCopyOKCallCreationStatus = txTestMCopyOKCallReceipt.getStatus(); Assertions.assertNotNull(txTestMCopyOKCallCreationStatus); Assertions.assertEquals(1, txTestMCopyOKCallCreationStatus.length); Assertions.assertEquals(1, txTestMCopyOKCallCreationStatus[0]); - // Check events + // Event Assertions + Assertions.assertEquals(1, TransactionReceiptUtil.getEventCount(txTestMCopyOKCallReceipt, "OK", null)); Assertions.assertEquals(0, TransactionReceiptUtil.getEventCount(txTestMCopyOKCallReceipt, "ERROR", null)); @@ -246,45 +217,38 @@ void testMCOPY_testCase4_behavesAsExpected() throws FileNotFoundException, DslPr // Assertions - // There's one block (b01) containing only 1 transaction Block block1 = world.getBlockByName("b01"); Assertions.assertNotNull(block1); Assertions.assertEquals(1, block1.getTransactionsList().size()); - // There's a transaction called txTestMCopy Transaction txTestMCopy = world.getTransactionByName("txTestMCopy"); Assertions.assertNotNull(txTestMCopy); - // Transaction txTestMCopy has a transaction receipt TransactionReceipt txTestMCopyReceipt = world.getTransactionReceiptByName("txTestMCopy"); Assertions.assertNotNull(txTestMCopyReceipt); - // Transaction txTestMCopy has been processed correctly byte[] creationStatus = txTestMCopyReceipt.getStatus(); Assertions.assertNotNull(creationStatus); Assertions.assertEquals(1, creationStatus.length); Assertions.assertEquals(1, creationStatus[0]); - // There's one block (b02) containing only 1 transaction Block block2 = world.getBlockByName("b02"); Assertions.assertNotNull(block2); Assertions.assertEquals(1, block2.getTransactionsList().size()); - // There's a transaction called txTestMCopyOKCall Transaction txTestMCopyOKCall = world.getTransactionByName("txTestMCopyOKCall"); Assertions.assertNotNull(txTestMCopyOKCall); - // Transaction txTestMCopyOKCall has a transaction receipt TransactionReceipt txTestMCopyOKCallReceipt = world.getTransactionReceiptByName("txTestMCopyOKCall"); Assertions.assertNotNull(txTestMCopyOKCallReceipt); - // Transaction txTestMCopyOKCall has been processed correctly byte[] txTestMCopyOKCallCreationStatus = txTestMCopyOKCallReceipt.getStatus(); Assertions.assertNotNull(txTestMCopyOKCallCreationStatus); Assertions.assertEquals(1, txTestMCopyOKCallCreationStatus.length); Assertions.assertEquals(1, txTestMCopyOKCallCreationStatus[0]); - // Check events + // Event Assertions + Assertions.assertEquals(1, TransactionReceiptUtil.getEventCount(txTestMCopyOKCallReceipt, "OK", null)); Assertions.assertEquals(0, TransactionReceiptUtil.getEventCount(txTestMCopyOKCallReceipt, "ERROR", null)); @@ -303,45 +267,38 @@ void testMCOPY_overwriteCases_behaveAsExpected() throws FileNotFoundException, D // Assertions - // There's one block (b01) containing only 1 transaction Block block1 = world.getBlockByName("b01"); Assertions.assertNotNull(block1); Assertions.assertEquals(1, block1.getTransactionsList().size()); - // There's a transaction called txTestMCopy Transaction txTestMCopy = world.getTransactionByName("txTestMCopy"); Assertions.assertNotNull(txTestMCopy); - // Transaction txTestMCopy has a transaction receipt TransactionReceipt txTestMCopyReceipt = world.getTransactionReceiptByName("txTestMCopy"); Assertions.assertNotNull(txTestMCopyReceipt); - // Transaction txTestMCopy has been processed correctly byte[] creationStatus = txTestMCopyReceipt.getStatus(); Assertions.assertNotNull(creationStatus); Assertions.assertEquals(1, creationStatus.length); Assertions.assertEquals(1, creationStatus[0]); - // There's one block (b02) containing only 1 transaction Block block2 = world.getBlockByName("b02"); Assertions.assertNotNull(block2); Assertions.assertEquals(1, block2.getTransactionsList().size()); - // There's a transaction called txTestMCopyOKCall Transaction txTestMCopyOKCall = world.getTransactionByName("txTestMCopyOKCall"); Assertions.assertNotNull(txTestMCopyOKCall); - // Transaction txTestMCopyOKCall has a transaction receipt TransactionReceipt txTestMCopyOKCallReceipt = world.getTransactionReceiptByName("txTestMCopyOKCall"); Assertions.assertNotNull(txTestMCopyOKCallReceipt); - // Transaction txTestMCopyOKCall has been processed correctly byte[] txTestMCopyOKCallCreationStatus = txTestMCopyOKCallReceipt.getStatus(); Assertions.assertNotNull(txTestMCopyOKCallCreationStatus); Assertions.assertEquals(1, txTestMCopyOKCallCreationStatus.length); Assertions.assertEquals(1, txTestMCopyOKCallCreationStatus[0]); - // Check events + // Event Assertions + Assertions.assertEquals(1, TransactionReceiptUtil.getEventCount(txTestMCopyOKCallReceipt, "ZERO_INPUTS_OK", null)); Assertions.assertEquals(1, TransactionReceiptUtil.getEventCount(txTestMCopyOKCallReceipt, "SINGLE_BYTE_REWRITE_OK", null)); Assertions.assertEquals(1, TransactionReceiptUtil.getEventCount(txTestMCopyOKCallReceipt, "FULL_WORD_REWRITE_OK", null)); @@ -370,45 +327,38 @@ void testMCOPY_fullMemoryClean_behaveAsExpected() throws FileNotFoundException, // Assertions - // There's one block (b01) containing only 1 transaction Block block1 = world.getBlockByName("b01"); Assertions.assertNotNull(block1); Assertions.assertEquals(1, block1.getTransactionsList().size()); - // There's a transaction called txTestMCopy Transaction txTestMCopy = world.getTransactionByName("txTestMCopy"); Assertions.assertNotNull(txTestMCopy); - // Transaction txTestMCopy has a transaction receipt TransactionReceipt txTestMCopyReceipt = world.getTransactionReceiptByName("txTestMCopy"); Assertions.assertNotNull(txTestMCopyReceipt); - // Transaction txTestMCopy has been processed correctly byte[] creationStatus = txTestMCopyReceipt.getStatus(); Assertions.assertNotNull(creationStatus); Assertions.assertEquals(1, creationStatus.length); Assertions.assertEquals(1, creationStatus[0]); - // There's one block (b02) containing only 1 transaction Block block2 = world.getBlockByName("b02"); Assertions.assertNotNull(block2); Assertions.assertEquals(1, block2.getTransactionsList().size()); - // There's a transaction called txTestMCopyOKCall Transaction txTestMCopyOKCall = world.getTransactionByName("txTestMCopyOKCall"); Assertions.assertNotNull(txTestMCopyOKCall); - // Transaction txTestMCopyOKCall has a transaction receipt TransactionReceipt txTestMCopyOKCallReceipt = world.getTransactionReceiptByName("txTestMCopyOKCall"); Assertions.assertNotNull(txTestMCopyOKCallReceipt); - // Transaction txTestMCopyOKCall has been processed correctly byte[] txTestMCopyOKCallCreationStatus = txTestMCopyOKCallReceipt.getStatus(); Assertions.assertNotNull(txTestMCopyOKCallCreationStatus); Assertions.assertEquals(1, txTestMCopyOKCallCreationStatus.length); Assertions.assertEquals(1, txTestMCopyOKCallCreationStatus[0]); - // Check events + // Event Assertions + Assertions.assertEquals(1, TransactionReceiptUtil.getEventCount(txTestMCopyOKCallReceipt, "OK", null)); Assertions.assertEquals(0, TransactionReceiptUtil.getEventCount(txTestMCopyOKCallReceipt, "ERROR", null)); @@ -424,45 +374,38 @@ void testMCOPY_fullMemoryCopy_behaveAsExpected() throws FileNotFoundException, D // Assertions - // There's one block (b01) containing only 1 transaction Block block1 = world.getBlockByName("b01"); Assertions.assertNotNull(block1); Assertions.assertEquals(1, block1.getTransactionsList().size()); - // There's a transaction called txTestMCopy Transaction txTestMCopy = world.getTransactionByName("txTestMCopy"); Assertions.assertNotNull(txTestMCopy); - // Transaction txTestMCopy has a transaction receipt TransactionReceipt txTestMCopyReceipt = world.getTransactionReceiptByName("txTestMCopy"); Assertions.assertNotNull(txTestMCopyReceipt); - // Transaction txTestMCopy has been processed correctly byte[] creationStatus = txTestMCopyReceipt.getStatus(); Assertions.assertNotNull(creationStatus); Assertions.assertEquals(1, creationStatus.length); Assertions.assertEquals(1, creationStatus[0]); - // There's one block (b02) containing only 1 transaction Block block2 = world.getBlockByName("b02"); Assertions.assertNotNull(block2); Assertions.assertEquals(1, block2.getTransactionsList().size()); - // There's a transaction called txTestMCopyOKCall Transaction txTestMCopyOKCall = world.getTransactionByName("txTestMCopyOKCall"); Assertions.assertNotNull(txTestMCopyOKCall); - // Transaction txTestMCopyOKCall has a transaction receipt TransactionReceipt txTestMCopyOKCallReceipt = world.getTransactionReceiptByName("txTestMCopyOKCall"); Assertions.assertNotNull(txTestMCopyOKCallReceipt); - // Transaction txTestMCopyOKCall has been processed correctly byte[] txTestMCopyOKCallCreationStatus = txTestMCopyOKCallReceipt.getStatus(); Assertions.assertNotNull(txTestMCopyOKCallCreationStatus); Assertions.assertEquals(1, txTestMCopyOKCallCreationStatus.length); Assertions.assertEquals(1, txTestMCopyOKCallCreationStatus[0]); - // Check events + // Event Assertions + Assertions.assertEquals(1, TransactionReceiptUtil.getEventCount(txTestMCopyOKCallReceipt, "OK", null)); Assertions.assertEquals(0, TransactionReceiptUtil.getEventCount(txTestMCopyOKCallReceipt, "ERROR", null)); @@ -478,45 +421,38 @@ void testMCOPY_fullMemoryCopyOffset_behaveAsExpected() throws FileNotFoundExcept // Assertions - // There's one block (b01) containing only 1 transaction Block block1 = world.getBlockByName("b01"); Assertions.assertNotNull(block1); Assertions.assertEquals(1, block1.getTransactionsList().size()); - // There's a transaction called txTestMCopy Transaction txTestMCopy = world.getTransactionByName("txTestMCopy"); Assertions.assertNotNull(txTestMCopy); - // Transaction txTestMCopy has a transaction receipt TransactionReceipt txTestMCopyReceipt = world.getTransactionReceiptByName("txTestMCopy"); Assertions.assertNotNull(txTestMCopyReceipt); - // Transaction txTestMCopy has been processed correctly byte[] creationStatus = txTestMCopyReceipt.getStatus(); Assertions.assertNotNull(creationStatus); Assertions.assertEquals(1, creationStatus.length); Assertions.assertEquals(1, creationStatus[0]); - // There's one block (b02) containing only 1 transaction Block block2 = world.getBlockByName("b02"); Assertions.assertNotNull(block2); Assertions.assertEquals(1, block2.getTransactionsList().size()); - // There's a transaction called txTestMCopyOKCall Transaction txTestMCopyOKCall = world.getTransactionByName("txTestMCopyOKCall"); Assertions.assertNotNull(txTestMCopyOKCall); - // Transaction txTestMCopyOKCall has a transaction receipt TransactionReceipt txTestMCopyOKCallReceipt = world.getTransactionReceiptByName("txTestMCopyOKCall"); Assertions.assertNotNull(txTestMCopyOKCallReceipt); - // Transaction txTestMCopyOKCall has been processed correctly byte[] txTestMCopyOKCallCreationStatus = txTestMCopyOKCallReceipt.getStatus(); Assertions.assertNotNull(txTestMCopyOKCallCreationStatus); Assertions.assertEquals(1, txTestMCopyOKCallCreationStatus.length); Assertions.assertEquals(1, txTestMCopyOKCallCreationStatus[0]); - // Check events + // Event Assertions + Assertions.assertEquals(1, TransactionReceiptUtil.getEventCount(txTestMCopyOKCallReceipt, "OK", null)); Assertions.assertEquals(0, TransactionReceiptUtil.getEventCount(txTestMCopyOKCallReceipt, "ERROR", null)); @@ -532,45 +468,38 @@ void testMCOPY_fullMemoryRewrite_behaveAsExpected() throws FileNotFoundException // Assertions - // There's one block (b01) containing only 1 transaction Block block1 = world.getBlockByName("b01"); Assertions.assertNotNull(block1); Assertions.assertEquals(1, block1.getTransactionsList().size()); - // There's a transaction called txTestMCopy Transaction txTestMCopy = world.getTransactionByName("txTestMCopy"); Assertions.assertNotNull(txTestMCopy); - // Transaction txTestMCopy has a transaction receipt TransactionReceipt txTestMCopyReceipt = world.getTransactionReceiptByName("txTestMCopy"); Assertions.assertNotNull(txTestMCopyReceipt); - // Transaction txTestMCopy has been processed correctly byte[] creationStatus = txTestMCopyReceipt.getStatus(); Assertions.assertNotNull(creationStatus); Assertions.assertEquals(1, creationStatus.length); Assertions.assertEquals(1, creationStatus[0]); - // There's one block (b02) containing only 1 transaction Block block2 = world.getBlockByName("b02"); Assertions.assertNotNull(block2); Assertions.assertEquals(1, block2.getTransactionsList().size()); - // There's a transaction called txTestMCopyOKCall Transaction txTestMCopyOKCall = world.getTransactionByName("txTestMCopyOKCall"); Assertions.assertNotNull(txTestMCopyOKCall); - // Transaction txTestMCopyOKCall has a transaction receipt TransactionReceipt txTestMCopyOKCallReceipt = world.getTransactionReceiptByName("txTestMCopyOKCall"); Assertions.assertNotNull(txTestMCopyOKCallReceipt); - // Transaction txTestMCopyOKCall has been processed correctly byte[] txTestMCopyOKCallCreationStatus = txTestMCopyOKCallReceipt.getStatus(); Assertions.assertNotNull(txTestMCopyOKCallCreationStatus); Assertions.assertEquals(1, txTestMCopyOKCallCreationStatus.length); Assertions.assertEquals(1, txTestMCopyOKCallCreationStatus[0]); - // Check events + // Event Assertions + Assertions.assertEquals(1, TransactionReceiptUtil.getEventCount(txTestMCopyOKCallReceipt, "OK", null)); Assertions.assertEquals(0, TransactionReceiptUtil.getEventCount(txTestMCopyOKCallReceipt, "ERROR", null)); @@ -588,45 +517,38 @@ void testMCOPY_outOfBoundsMemoryExtension_behaveAsExpected() throws FileNotFound // Assertions - // There's one block (b01) containing only 1 transaction Block block1 = world.getBlockByName("b01"); Assertions.assertNotNull(block1); Assertions.assertEquals(1, block1.getTransactionsList().size()); - // There's a transaction called txTestMCopy Transaction txTestMCopy = world.getTransactionByName("txTestMCopy"); Assertions.assertNotNull(txTestMCopy); - // Transaction txTestMCopy has a transaction receipt TransactionReceipt txTestMCopyReceipt = world.getTransactionReceiptByName("txTestMCopy"); Assertions.assertNotNull(txTestMCopyReceipt); - // Transaction txTestMCopy has been processed correctly byte[] creationStatus = txTestMCopyReceipt.getStatus(); Assertions.assertNotNull(creationStatus); Assertions.assertEquals(1, creationStatus.length); Assertions.assertEquals(1, creationStatus[0]); - // There's one block (b02) containing only 1 transaction Block block2 = world.getBlockByName("b02"); Assertions.assertNotNull(block2); Assertions.assertEquals(1, block2.getTransactionsList().size()); - // There's a transaction called txTestMCopyOKCall Transaction txTestMCopyOKCall = world.getTransactionByName("txTestMCopyOKCall"); Assertions.assertNotNull(txTestMCopyOKCall); - // Transaction txTestMCopyOKCall has a transaction receipt TransactionReceipt txTestMCopyOKCallReceipt = world.getTransactionReceiptByName("txTestMCopyOKCall"); Assertions.assertNotNull(txTestMCopyOKCallReceipt); - // Transaction txTestMCopyOKCall has been processed correctly byte[] txTestMCopyOKCallCreationStatus = txTestMCopyOKCallReceipt.getStatus(); Assertions.assertNotNull(txTestMCopyOKCallCreationStatus); Assertions.assertEquals(1, txTestMCopyOKCallCreationStatus.length); Assertions.assertEquals(1, txTestMCopyOKCallCreationStatus[0]); - // Check events + // Event Assertions + Assertions.assertEquals(1, TransactionReceiptUtil.getEventCount(txTestMCopyOKCallReceipt, "OK", null)); Assertions.assertEquals(0, TransactionReceiptUtil.getEventCount(txTestMCopyOKCallReceipt, "ERROR", null)); @@ -642,45 +564,38 @@ void testMCOPY_singleByteMemoryExtension_behaveAsExpected() throws FileNotFoundE // Assertions - // There's one block (b01) containing only 1 transaction Block block1 = world.getBlockByName("b01"); Assertions.assertNotNull(block1); Assertions.assertEquals(1, block1.getTransactionsList().size()); - // There's a transaction called txTestMCopy Transaction txTestMCopy = world.getTransactionByName("txTestMCopy"); Assertions.assertNotNull(txTestMCopy); - // Transaction txTestMCopy has a transaction receipt TransactionReceipt txTestMCopyReceipt = world.getTransactionReceiptByName("txTestMCopy"); Assertions.assertNotNull(txTestMCopyReceipt); - // Transaction txTestMCopy has been processed correctly byte[] creationStatus = txTestMCopyReceipt.getStatus(); Assertions.assertNotNull(creationStatus); Assertions.assertEquals(1, creationStatus.length); Assertions.assertEquals(1, creationStatus[0]); - // There's one block (b02) containing only 1 transaction Block block2 = world.getBlockByName("b02"); Assertions.assertNotNull(block2); Assertions.assertEquals(1, block2.getTransactionsList().size()); - // There's a transaction called txTestMCopyOKCall Transaction txTestMCopyOKCall = world.getTransactionByName("txTestMCopyOKCall"); Assertions.assertNotNull(txTestMCopyOKCall); - // Transaction txTestMCopyOKCall has a transaction receipt TransactionReceipt txTestMCopyOKCallReceipt = world.getTransactionReceiptByName("txTestMCopyOKCall"); Assertions.assertNotNull(txTestMCopyOKCallReceipt); - // Transaction txTestMCopyOKCall has been processed correctly byte[] txTestMCopyOKCallCreationStatus = txTestMCopyOKCallReceipt.getStatus(); Assertions.assertNotNull(txTestMCopyOKCallCreationStatus); Assertions.assertEquals(1, txTestMCopyOKCallCreationStatus.length); Assertions.assertEquals(1, txTestMCopyOKCallCreationStatus[0]); - // Check events + // Event Assertions + Assertions.assertEquals(1, TransactionReceiptUtil.getEventCount(txTestMCopyOKCallReceipt, "OK", null)); Assertions.assertEquals(0, TransactionReceiptUtil.getEventCount(txTestMCopyOKCallReceipt, "ERROR", null)); @@ -696,45 +611,38 @@ void testMCOPY_singleWordMemoryExtension_behaveAsExpected() throws FileNotFoundE // Assertions - // There's one block (b01) containing only 1 transaction Block block1 = world.getBlockByName("b01"); Assertions.assertNotNull(block1); Assertions.assertEquals(1, block1.getTransactionsList().size()); - // There's a transaction called txTestMCopy Transaction txTestMCopy = world.getTransactionByName("txTestMCopy"); Assertions.assertNotNull(txTestMCopy); - // Transaction txTestMCopy has a transaction receipt TransactionReceipt txTestMCopyReceipt = world.getTransactionReceiptByName("txTestMCopy"); Assertions.assertNotNull(txTestMCopyReceipt); - // Transaction txTestMCopy has been processed correctly byte[] creationStatus = txTestMCopyReceipt.getStatus(); Assertions.assertNotNull(creationStatus); Assertions.assertEquals(1, creationStatus.length); Assertions.assertEquals(1, creationStatus[0]); - // There's one block (b02) containing only 1 transaction Block block2 = world.getBlockByName("b02"); Assertions.assertNotNull(block2); Assertions.assertEquals(1, block2.getTransactionsList().size()); - // There's a transaction called txTestMCopyOKCall Transaction txTestMCopyOKCall = world.getTransactionByName("txTestMCopyOKCall"); Assertions.assertNotNull(txTestMCopyOKCall); - // Transaction txTestMCopyOKCall has a transaction receipt TransactionReceipt txTestMCopyOKCallReceipt = world.getTransactionReceiptByName("txTestMCopyOKCall"); Assertions.assertNotNull(txTestMCopyOKCallReceipt); - // Transaction txTestMCopyOKCall has been processed correctly byte[] txTestMCopyOKCallCreationStatus = txTestMCopyOKCallReceipt.getStatus(); Assertions.assertNotNull(txTestMCopyOKCallCreationStatus); Assertions.assertEquals(1, txTestMCopyOKCallCreationStatus.length); Assertions.assertEquals(1, txTestMCopyOKCallCreationStatus[0]); - // Check events + // Event Assertions + Assertions.assertEquals(1, TransactionReceiptUtil.getEventCount(txTestMCopyOKCallReceipt, "OK", null)); Assertions.assertEquals(0, TransactionReceiptUtil.getEventCount(txTestMCopyOKCallReceipt, "ERROR", null)); @@ -750,45 +658,38 @@ void testMCOPY_singleWordMinusOneByteMemoryExtension_behaveAsExpected() throws F // Assertions - // There's one block (b01) containing only 1 transaction Block block1 = world.getBlockByName("b01"); Assertions.assertNotNull(block1); Assertions.assertEquals(1, block1.getTransactionsList().size()); - // There's a transaction called txTestMCopy Transaction txTestMCopy = world.getTransactionByName("txTestMCopy"); Assertions.assertNotNull(txTestMCopy); - // Transaction txTestMCopy has a transaction receipt TransactionReceipt txTestMCopyReceipt = world.getTransactionReceiptByName("txTestMCopy"); Assertions.assertNotNull(txTestMCopyReceipt); - // Transaction txTestMCopy has been processed correctly byte[] creationStatus = txTestMCopyReceipt.getStatus(); Assertions.assertNotNull(creationStatus); Assertions.assertEquals(1, creationStatus.length); Assertions.assertEquals(1, creationStatus[0]); - // There's one block (b02) containing only 1 transaction Block block2 = world.getBlockByName("b02"); Assertions.assertNotNull(block2); Assertions.assertEquals(1, block2.getTransactionsList().size()); - // There's a transaction called txTestMCopyOKCall Transaction txTestMCopyOKCall = world.getTransactionByName("txTestMCopyOKCall"); Assertions.assertNotNull(txTestMCopyOKCall); - // Transaction txTestMCopyOKCall has a transaction receipt TransactionReceipt txTestMCopyOKCallReceipt = world.getTransactionReceiptByName("txTestMCopyOKCall"); Assertions.assertNotNull(txTestMCopyOKCallReceipt); - // Transaction txTestMCopyOKCall has been processed correctly byte[] txTestMCopyOKCallCreationStatus = txTestMCopyOKCallReceipt.getStatus(); Assertions.assertNotNull(txTestMCopyOKCallCreationStatus); Assertions.assertEquals(1, txTestMCopyOKCallCreationStatus.length); Assertions.assertEquals(1, txTestMCopyOKCallCreationStatus[0]); - // Check events + // Event Assertions + Assertions.assertEquals(1, TransactionReceiptUtil.getEventCount(txTestMCopyOKCallReceipt, "OK", null)); Assertions.assertEquals(0, TransactionReceiptUtil.getEventCount(txTestMCopyOKCallReceipt, "ERROR", null)); @@ -804,45 +705,38 @@ void testMCOPY_singleWordPlusOneByteMemoryExtension_behaveAsExpected() throws Fi // Assertions - // There's one block (b01) containing only 1 transaction Block block1 = world.getBlockByName("b01"); Assertions.assertNotNull(block1); Assertions.assertEquals(1, block1.getTransactionsList().size()); - // There's a transaction called txTestMCopy Transaction txTestMCopy = world.getTransactionByName("txTestMCopy"); Assertions.assertNotNull(txTestMCopy); - // Transaction txTestMCopy has a transaction receipt TransactionReceipt txTestMCopyReceipt = world.getTransactionReceiptByName("txTestMCopy"); Assertions.assertNotNull(txTestMCopyReceipt); - // Transaction txTestMCopy has been processed correctly byte[] creationStatus = txTestMCopyReceipt.getStatus(); Assertions.assertNotNull(creationStatus); Assertions.assertEquals(1, creationStatus.length); Assertions.assertEquals(1, creationStatus[0]); - // There's one block (b02) containing only 1 transaction Block block2 = world.getBlockByName("b02"); Assertions.assertNotNull(block2); Assertions.assertEquals(1, block2.getTransactionsList().size()); - // There's a transaction called txTestMCopyOKCall Transaction txTestMCopyOKCall = world.getTransactionByName("txTestMCopyOKCall"); Assertions.assertNotNull(txTestMCopyOKCall); - // Transaction txTestMCopyOKCall has a transaction receipt TransactionReceipt txTestMCopyOKCallReceipt = world.getTransactionReceiptByName("txTestMCopyOKCall"); Assertions.assertNotNull(txTestMCopyOKCallReceipt); - // Transaction txTestMCopyOKCall has been processed correctly byte[] txTestMCopyOKCallCreationStatus = txTestMCopyOKCallReceipt.getStatus(); Assertions.assertNotNull(txTestMCopyOKCallCreationStatus); Assertions.assertEquals(1, txTestMCopyOKCallCreationStatus.length); Assertions.assertEquals(1, txTestMCopyOKCallCreationStatus[0]); - // Check events + // Event Assertions + Assertions.assertEquals(1, TransactionReceiptUtil.getEventCount(txTestMCopyOKCallReceipt, "OK", null)); Assertions.assertEquals(0, TransactionReceiptUtil.getEventCount(txTestMCopyOKCallReceipt, "ERROR", null));