godsflaw / crucible.js Goto Github PK
View Code? Open in Web Editor NEWcrucible.js is a library for interacting with Crucible smart contracts
License: MIT License
crucible.js is a library for interacting with Crucible smart contracts
License: MIT License
Add the interface for collectFee()
.
None
Add the state change function finish()
to the library.
None
Implement addCommitment()
, getCommitmentCount()
, and participantExists()
on LibCrucible
.
None
Add the payout()
call to crucible.js.
None
We need a wait to waitForTxToComplete()
after sending a transaction. This is going to need to take the transaction hash and return a TransactionReceipt
. This function alone will add the proper waiting after sending a transaction to allow the caller to know it's okay to proceed with other API calls.
We should also add ways to get the contents of log messages for transactions that log a message. We can do this by passing the receipt, and perhaps also building an event listener for such events. This would allow validators to edge trigger actions based on events.
None
Implement the interface and tests for setGoal()
and judgement()
.
None
When implementing addCommitment()
it failed to catch the error for a risk amount that was set too low. After chasing this bug out, it would appear that ANY on-chain reject will come in out-of-band from the try/catch and interrupt the library. There are ways to catch this with web3.js, but one must use event listeners. This radically complicates the interface to LibCrucible and puts a lot onto the user of the library to implement all that error handling in event handlers. Making such a change would ruin the async/await interface and make using the library a mess.
The only option I can see is implementing an assertion framework into the API interface that is aware of every possible assertion that we could throw on-chain. The downside to this is that we have to duplicate a bunch of those assertions handled in the crucible code into the library. The upside is that web3.js has no current ability to let the contents of those assertion failures bubble up from the chain. Meaning users would be left guessing about what failed. Putting assertions in the library would fix this. What's more, a transaction that would fail on chain (so after the user signs and sends the transaction), is now likely to throw the error before any of that interface is invoked.
These two benefits clearly outweigh the concerns of duplicating assertion handling into the library.
None
Create the interface off of the foundry that can create a new crucible. Experiment with returning a fully instantiated Crucible, but be cognizant of the delay to have this block mined and find a solution. Make sure this is implemented, well tested as a unit test and integration, and documented.
None
Add a private getIndexOf()
and a public deleteCrucible()
. Both functions work off the foundry. There is likely no need to expose getIndexOf()
.
None
Add libcrucible.lock()
state transition to LibCrucible.
None
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.