Skip to content

Commit

Permalink
AKI-453: Fixed issues in AionList
Browse files Browse the repository at this point in the history
Fix bugs related to modCount calculation, returned values, concurrent modification and index range checks.
  • Loading branch information
aion-shidokht committed Nov 4, 2019
1 parent ec2e25f commit 83ea3ad
Show file tree
Hide file tree
Showing 5 changed files with 671 additions and 146 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,10 @@ private enum Contract {
@Test
public void testCostToDeployDapps() {
TransactionResult blake2bResult = deployContract(Contract.BLAKE2B);
Assert.assertEquals(4_591_258L, blake2bResult.energyUsed);
Assert.assertEquals(4_621_113L, blake2bResult.energyUsed);

TransactionResult walletResult = deployContract(Contract.POC_WALLET);
Assert.assertEquals(3_955_373L, walletResult.energyUsed);
Assert.assertEquals(3_985_228L, walletResult.energyUsed);
}

//<-----------------------------------------helpers-------------------------------------------->
Expand All @@ -100,7 +100,7 @@ private byte[] getDeploymentJarBytesForContract(Contract contract) {
Main.class,
Blake2b.class);
// Verify that this size doesn't unexpectedly change.
Assert.assertEquals(67_969L, jarBytes.length);
Assert.assertEquals(68_420L, jarBytes.length);
break;
case POC_WALLET:
jarBytes = classesToJarBytes(
Expand All @@ -114,7 +114,7 @@ private byte[] getDeploymentJarBytesForContract(Contract contract) {
Daylimit.class,
EventLogger.class);
// Verify that this size doesn't unexpectedly change.
Assert.assertEquals(58_241L, jarBytes.length);
Assert.assertEquals(58_692L, jarBytes.length);
break;
default: RuntimeAssertionError.unreachable("This should never be reached.");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public void testCostToDeployDapps() {
Assert.assertEquals(100_000_000_000L, result.energyUsed);

result = deployContract(Contract.BASIC_PERF);
Assert.assertEquals(2_032_564L, result.energyUsed);
Assert.assertEquals(2_062_419L, result.energyUsed);

result = deployContract(Contract.POC_EXCHANGE);
Assert.assertEquals(100_000_000_000L, result.energyUsed);
Expand Down Expand Up @@ -101,7 +101,7 @@ private byte[] getDeploymentJarBytesForContract(Contract contract) {
AionMap.class,
AionSet.class);
// Verify that this size doesn't unexpectedly change.
Assert.assertEquals(28_281L, jarBytes.length);
Assert.assertEquals(28_732L, jarBytes.length);
break;
case POC_EXCHANGE:
jarBytes = classesToJarBytes(
Expand All @@ -114,7 +114,7 @@ private byte[] getDeploymentJarBytesForContract(Contract contract) {
AionSet.class,
AionMap.class);
// Verify that this size doesn't unexpectedly change.
Assert.assertEquals(32_122L, jarBytes.length);
Assert.assertEquals(32_573L, jarBytes.length);
break;
case ERC20:
byte[] clinitArgs = ABIUtil.encodeMethodArguments("", "Pepe".toCharArray(), "PEPE".toCharArray(), 8);
Expand All @@ -126,7 +126,7 @@ private byte[] getDeploymentJarBytesForContract(Contract contract) {
AionSet.class,
AionMap.class);
// Verify that this size doesn't unexpectedly change.
Assert.assertEquals(27_561L, jarBytes.length);
Assert.assertEquals(28_012L, jarBytes.length);
break;
case BASIC_APP:
jarBytes = classesToJarBytes(
Expand All @@ -135,7 +135,7 @@ private byte[] getDeploymentJarBytesForContract(Contract contract) {
AionSet.class,
AionList.class);
// Verify that this size doesn't unexpectedly change.
Assert.assertEquals(25_655L, jarBytes.length);
Assert.assertEquals(26_106L, jarBytes.length);
break;
case TRS:
jarBytes = classesToJarBytes(
Expand Down
Loading

0 comments on commit 83ea3ad

Please sign in to comment.