checkpoint JavaScript VM

pull/1/head
yann300 5 years ago
parent 0b3033ed6c
commit a3cd459e6b
  1. 7
      src/app/tabs/runTab/model/settings.js
  2. 1
      src/app/udapp/run-tab.js

@ -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 {
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)

Loading…
Cancel
Save