Commit a3cd459e authored by yann300's avatar yann300

checkpoint JavaScript VM

parent 0b3033ed
...@@ -10,6 +10,13 @@ class Settings { ...@@ -10,6 +10,13 @@ class Settings {
constructor (udapp) { constructor (udapp) {
this.udapp = udapp this.udapp = udapp
this.event = new EventManager() this.event = new EventManager()
this.commits = 0
this.udapp.event.register('initiatingTransaction', (error, from, to, data, lookupOnly, txResult) => {
if (error) console.log(error)
executionContext.checkpointAndCommit(() => console.log('checkpoint on VM', this.commits), this.commits)
this.commits++
})
this.udapp.event.register('transactionExecuted', (error, from, to, data, lookupOnly, txResult) => { this.udapp.event.register('transactionExecuted', (error, from, to, data, lookupOnly, txResult) => {
this.event.trigger('transactionExecuted', [error, from, to, data, lookupOnly, txResult]) this.event.trigger('transactionExecuted', [error, from, to, data, lookupOnly, txResult])
......
...@@ -202,6 +202,7 @@ export class RunTab extends LibraryPlugin { ...@@ -202,6 +202,7 @@ export class RunTab extends LibraryPlugin {
executionContext.init(this.config) executionContext.init(this.config)
executionContext.stopListenOnLastBlock() executionContext.stopListenOnLastBlock()
executionContext.listenOnLastBlock() executionContext.listenOnLastBlock()
executionContext.checkpointAndCommit(() => console.log('checkpoint on VM'), 0)
this.udapp.resetEnvironment() this.udapp.resetEnvironment()
this.renderInstanceContainer() this.renderInstanceContainer()
this.renderSettings(this.udapp) this.renderSettings(this.udapp)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment