Comments (5)
See this for our rationale:
https://github.com/LeastAuthority/ethereum-analyses/blob/master/GasEcon.md#predictability
from truffle.
Hi @tymat. If I understand what you wrote correctly, this is already built in. Truffle uses Pudding under the hood, which makes ABI functions and sendTransaction() not call their callback until the transaction has been processed. The syntax is different than your example, but the effect is the same. Pudding uses promises to allow you to write the following:
val = "..." # some address
test = TestContract.at(TestContract.deployed_address)
test.setter(val, {from: caller}).then (tx) ->
# This code block won't be executed until the transaction tx has been processed.
# Note: The next line returns a promise.
test.addr.call()
.then (addr) ->
assert.isEqual(addr, val)
This should produce the effect you're looking for. Let me know if I misunderstood.
from truffle.
The function within Pudding that does exactly what you described is here: https://github.com/ConsenSys/ether-pudding/blob/master/src/pudding.coffee#L100
from truffle.
@tcoulter Thanks. That seems to work. Is there a way to set the timeout values?
from truffle.
Ya, that's a feature of mocha. There are three different scopes the timeouts can apply to. Consider this example:
contract "TestContract", (accounts) ->
# Each test has a timeout of ten seconds.
@timeout(10000)
before "do something before", (done) ->
# This before() hook has a timeout of 15 seconds.
@timeout(15000)
it "should test something", (done) ->
# This test has a timeout of 30 seconds.
@timeout(30000)
it "should do something else", (done) ->
# This test only has a timeout of 10 seconds, based on the timeout above.
from truffle.
Related Issues (20)
- Still using node-ipc instead of the fork HOT 4
- Truffle should have global technical support Channel to access for more contribution.
- Truffle migrate throwing Error "*** stack smashing detected ***: terminated" HOT 1
- TypeError: Cannot read properties of undefined (reading 'start') - Transaction that creates ERC20 contract HOT 7
- An error occurred while initializing the debugger. HOT 2
- Debugger shows incorrect value for a Yul variable HOT 4
- Client network socket disconnected before secure TLS connection was established HOT 2
- Running the command: npm install -g truffle generated error HOT 2
- adjusting to rpc limits HOT 2
- unbox failed,Error connecting to https://raw.githubusercontent.com/xxx HOT 2
- `truffle test --debug` hangs without starting the debugger HOT 5
- truffle test The following information will appear Download xxx HOT 5
- getting this error any solutions? HOT 1
- Error when running npm install -g truffle HOT 8
- "Upfront cost exceeds account balance" on Besu private zero gas network HOT 3
- receipt.to showing contract address HOT 2
- Truffle Compile SyntaxError HOT 1
- Issue using latest truffle migrate HOT 4
- Truffle is being sunset HOT 3
- "Everything is up to date, there is nothing to compile"
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from truffle.