somniastellarum / cpacademygoserver Goto Github PK
View Code? Open in Web Editor NEWThe Go Server being developed for the CPAcademy. Week 6
License: MIT License
The Go Server being developed for the CPAcademy. Week 6
License: MIT License
The BurnablePayment contract doesn't actually do any processing when the autorelease becomes available to the worker; the only thing that makes it "available" is that the require condition in triggerAutorelease "require(now >= autoreleaseTime)" will pass.
Because there is no processing, and no event triggered, the server currently has no way of knowing when this happens. This is unfortunate from a user experience perspective; a Buyer has an obvious interest in knowing that he can trigger the autorelease. A related feature would be to send out notifications when the autorelease is "coming soon"; this has utility for the Seller.
This isn't exactly trivial to set up though. The server would need to perform the above mentioned condition manually. Also, as things are currently written, there is an assumption that each notification originates from an event... Adding this feature violates that assumption, which means something will have to be rebuilt (for example, the "notifyParties" function takes an address and an event, but here there is no event).
Currently, when the server starts up, it starts scanning from the same starting block each time, which causes it to react to events it already processed on any previous run of the program.
A solution would be to simply store the last block scanned in ethReadLoop to a file, and load this upon startup to pass to the "go ethReadLoop(4200000)" line in main.go.
To reproduce, start the server and create a Toastytrade by interacting with the ToastytradeFactory contract directly. This part should correctly fire a notification if you have an email registered for the address you used as the Seller when creating a Toastytrade. Then, perform another action with the Toastytrade, such as recoverFunds or commit: ethReadLoop says it's scanning each range, but it won't seem to notice an event that really does occur.
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.