Add fix for emptyTransaction test

This commit is contained in:
Faiz Khan 2015-01-23 20:33:16 -06:00
parent bbc8e060ad
commit 36ea2069f4
2 changed files with 10 additions and 2 deletions

View File

@ -89,6 +89,16 @@ public class TransactionExecutor {
return;
}
//Insert gas cost protection
BigInteger gasLimit = new BigInteger(1, tx.getGasLimit());
if (gasLimit.compareTo(BigInteger.ZERO) == 0) {
logger.debug("No gas limit set on transaction: hash={}",
Hex.toHexString(tx.getHash()));
receipt.setCumulativeGas(0);
this.receipt = receipt;
return;
}
// FIND OUT THE TRANSACTION TYPE
final byte[] receiverAddress;

View File

@ -110,12 +110,10 @@ public class GitHubStateTest {
GitHubJSONTestSuite.runGitHubJsonStateTest(json, excluded);
}
@Test // todo: fix: excluded test
public void stTransactionTest() throws ParseException {
Set<String> excluded = new HashSet<>();
excluded.add("EmptyTransaction");
//todo: it goes OOG, because no gasLimit is given. So it does not change the state.