Merge pull request #214 from 8aff8265aa/master

Add fix for emptyTransaction test
This commit is contained in:
Roman Mandeleil 2015-01-24 20:42:11 +02:00
commit f3e067d28b
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.