-
Notifications
You must be signed in to change notification settings - Fork 586
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
Validate before calculating checksum, move private functions at end, add context to mockvm errors. #5157
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Thanks for the PR, @DimitrisJim.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM thanks for the clean up, just one mega nit
@@ -122,15 +122,15 @@ type MockWasmEngine struct { | |||
// StoreCode implements the WasmEngine interface. | |||
func (m *MockWasmEngine) StoreCode(code wasmvm.WasmCode) (wasmvm.Checksum, error) { | |||
if m.StoreCodeFn == nil { | |||
panic("mock engine is not properly initialized") | |||
panic("mock engine is not properly initialized: StoreCodeFn is nil") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
since we are modifying it already, a mega nit would be to change these to errors, I think we try and panic on errors in almost all places where we have panics.
…n vm.go, add context to mockvm errors.
8ae7ba3
to
413037d
Compare
…add context to mockvm errors. (backport #5157) (#5265) * Validate before calculating checksum, move private functions at end, add context to mockvm errors. (#5157) * Validate before calculating checksum, move private functions at end in vm.go, add context to mockvm errors. * panic with errors. (cherry picked from commit 4bb8edd) # Conflicts: # modules/light-clients/08-wasm/types/vm.go * Fix conflicts. --------- Co-authored-by: DimitrisJim <d.f.hilliard@gmail.com>
Description
couple of minor nits that were brought up.
closes: #XXXX
Commit Message / Changelog Entry
see the guidelines for commit messages. (view raw markdown for examples)
Before we can merge this PR, please make sure that all the following items have been
checked off. If any of the checklist items are not applicable, please leave them but
write a little note why.
docs/
) or specification (x/<module>/spec/
).godoc
comments.Files changed
in the Github PR explorer.Codecov Report
in the comment section below once CI passes.