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

Validate before calculating checksum, move private functions at end, add context to mockvm errors. #5157

Merged
merged 2 commits into from
Nov 22, 2023

Conversation

DimitrisJim
Copy link
Contributor

Description

couple of minor nits that were brought up.

closes: #XXXX

Commit Message / Changelog Entry

chore: Validate before calculating checksum, move private functions at end, add context to mockvm errors.

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.

  • Targeted PR against correct branch (see CONTRIBUTING.md).
  • Linked to Github issue with discussion and accepted design OR link to spec that describes this work.
  • Code follows the module structure standards and Go style guide.
  • Wrote unit and integration tests.
  • Updated relevant documentation (docs/) or specification (x/<module>/spec/).
  • Added relevant godoc comments.
  • Provide a commit message to be used for the changelog entry in the PR description for review.
  • Re-reviewed Files changed in the Github PR explorer.
  • Review Codecov Report in the comment section below once CI passes.

Copy link
Contributor

@crodriguezvega crodriguezvega 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. Thanks for the PR, @DimitrisJim.

Copy link
Contributor

@chatton chatton left a 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")
Copy link
Contributor

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.

@DimitrisJim DimitrisJim enabled auto-merge (squash) November 22, 2023 12:30
@DimitrisJim DimitrisJim merged commit 4bb8edd into main Nov 22, 2023
71 of 72 checks passed
@DimitrisJim DimitrisJim deleted the jim/minor-wasm-nits branch November 22, 2023 12:35
mergify bot pushed a commit that referenced this pull request Nov 30, 2023
…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
mergify bot pushed a commit that referenced this pull request Nov 30, 2023
…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)
DimitrisJim added a commit that referenced this pull request Nov 30, 2023
…add context to mockvm errors. (#5157) (#5266)

* 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)

Co-authored-by: DimitrisJim <d.f.hilliard@gmail.com>
DimitrisJim added a commit that referenced this pull request Nov 30, 2023
…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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants