Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate stateManager and storageReader to es6 class syntax #452

Merged
merged 2 commits into from
Feb 26, 2019

Conversation

s1na
Copy link
Contributor

@s1na s1na commented Feb 25, 2019

No description provided.

holgerd77
holgerd77 previously approved these changes Feb 25, 2019
Copy link
Member

@holgerd77 holgerd77 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good and can be merged once tests can be retriggered.

this._cache = new Cache(this._trie)
this._touched = new Set()
this._touchedStack = []
this._checkpointCount = 0
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok.

@@ -11,557 +11,524 @@ const rlp = utils.rlp

/**
* Interface for getting and setting data from an underlying
* state trie
* @interface StateManager
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not have a strong opinion about this, just for clarification: did this not fit enough the definition of the tag?

*/
copy () {
return new StateManager({ trie: this._trie.copy() })
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok.

*/
getAccount (address, cb) {
this._cache.getOrLoad(address, cb)
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok.

this._touched.add(address.toString('hex'))
// self._trie.put(addressHex, account.serialize(), cb)
cb()
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok.

cb(err)
}
})
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok.

address = utils.toBuffer(address)
this._trie.put(address, account.serialize(), done)
}, cb)
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok.

self._touched.clear()
cb()
})
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok.

this._touched.clear()
cb()
})
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok.

})
})
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok.

@coveralls
Copy link

coveralls commented Feb 26, 2019

Coverage Status

Coverage decreased (-0.1%) to 92.158% when pulling c9c7781 on refactor/es6-state into 49d62cc on master.

Copy link
Member

@holgerd77 holgerd77 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants