You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 21, 2022. It is now read-only.
If there's any exception such as insufficient gas, subsequent transactions fail with a bad nonce, even though I properly catch the exception in the code.
Error: the tx doesn't have the correct nonce. account has nonce of: 8 tx has nonce of: 7
Below is a patch to ethereum-pudding's test code to show the problem:
This is not reproducible using geth. Simulation != real world issue.
diff --git a/test/contracts.js b/test/contracts.js
index 76e430a..9e2d0e9 100644
--- a/test/contracts.js
+++ b/test/contracts.js
@@ -18,6 +18,7 @@ var binary = compiled.bytecode;
// Setup
var web3 = new Web3();
web3.setProvider(TestRPC.provider());
+//web3.setProvider(new web3.providers.HttpProvider("http://localhost:8110"));
Pudding.setWeb3(web3);
var tests = function(contract_instantiator) {
@@ -109,6 +110,7 @@ var tests = function(contract_instantiator) {
// BigNumber passed in a transaction.
return example.setValue(new Pudding.BigNumber(25));
}).then(function(tx) {
+ console.log(tx);
return example.value.call();
}).then(function(value) {
assert.equal(value.valueOf(), 25, "Ending value should be twenty-five");
@@ -118,10 +120,31 @@ var tests = function(contract_instantiator) {
assert.equal(parrot_value.valueOf(), 865, "Parrotted value should equal 865")
}).then(done).catch(done);
});
+
+ it("should throw when running out of gas", function(done) {
+ var example;
+ Example.new().then(function(instance) {
+ example = instance;
+ return example.value.call();
+ }).then(function(value) {
+ assert.equal(value.valueOf(), 1, "Starting value should be 1");
+ return example.setValue(5, {gas: 20000});
+ }).then(function(tx) {
+ return example.value.call();
+ }).then(function(value) {
+ assert.equal(value.valueOf(), 5, "Ending value should be five");
+ }).then(done).catch(function(err) {
+ console.log("properly caught out of gas error");
+ console.log(err);
+ done();
+ });
+ });
};
describe("Contract abstractions", function() {
+ this.timeout(40000); // enough for stock real node e.g. geth
+
describe("when using .whisk()", function() {
tests(function(callback) {
callback(null, Pudding.whisk({
The text was updated successfully, but these errors were encountered:
If there's any exception such as insufficient gas, subsequent transactions fail with a bad nonce, even though I properly catch the exception in the code.
Error: the tx doesn't have the correct nonce. account has nonce of: 8 tx has nonce of: 7
Below is a patch to ethereum-pudding's test code to show the problem:
This is not reproducible using geth. Simulation != real world issue.
The text was updated successfully, but these errors were encountered: