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

imp: use wasm VM CreateChecksum #5123

Conversation

crodriguezvega
Copy link
Contributor

Description

closes: #5071

Commit Message / Changelog Entry

type: commit message

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.

@@ -1,9 +0,0 @@
package keeper
Copy link
Contributor

Choose a reason for hiding this comment

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

🪓 🪓

"github.com/cosmos/ibc-go/modules/light-clients/08-wasm/internal/ibcwasm"
)

// Checksum is a type alias used for wasm byte code checksums.
type Checksum []byte
type Checksum = wasmvmtypes.Checksum
Copy link
Contributor

@DimitrisJim DimitrisJim Nov 17, 2023

Choose a reason for hiding this comment

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

not strictly necessary to do this alias and wrapping, helps with keeping these local to this file, removing imports and allowing for localized changes if they are required in future. Could drop if people don't like it

Copy link
Member

@damiannolan damiannolan left a comment

Choose a reason for hiding this comment

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

Beautiful! Nice cleanup @crodriguezvega ❤️

modules/light-clients/08-wasm/keeper/keeper.go Outdated Show resolved Hide resolved
modules/light-clients/08-wasm/types/wasm.go Show resolved Hide resolved
Copy link
Contributor

@DimitrisJim DimitrisJim left a comment

Choose a reason for hiding this comment

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

looks gorgeous to me!

@crodriguezvega
Copy link
Contributor Author

Thank you for your contributions on this one, @DimitrisJim!

@crodriguezvega crodriguezvega merged commit a231fea into main Nov 20, 2023
73 checks passed
@crodriguezvega crodriguezvega deleted the carlos/5071-use-wasmvmcreatechecksum-instead-of-duplicating-it branch November 20, 2023 19:07
mergify bot pushed a commit that referenced this pull request Nov 20, 2023
* use wasm VM CreateChecksum

* review comments

* lint

* lint 2

* Remove raw calls to sha256, clean up handling of Checksums.

* Update modules/light-clients/08-wasm/keeper/keeper.go

Co-authored-by: Damian Nolan <damiannolan@gmail.com>

* Document this bad boy.

---------

Co-authored-by: DimitrisJim <d.f.hilliard@gmail.com>
Co-authored-by: Damian Nolan <damiannolan@gmail.com>
(cherry picked from commit a231fea)

# Conflicts:
#	modules/light-clients/08-wasm/keeper/events.go
#	modules/light-clients/08-wasm/keeper/genesis.go
#	modules/light-clients/08-wasm/keeper/keeper.go
#	modules/light-clients/08-wasm/keeper/msg_server_test.go
#	modules/light-clients/08-wasm/keeper/snapshotter.go
#	modules/light-clients/08-wasm/keeper/snapshotter_test.go
#	modules/light-clients/08-wasm/testing/mock_engine.go
#	modules/light-clients/08-wasm/testing/values.go
#	modules/light-clients/08-wasm/testing/wasm_endpoint.go
#	modules/light-clients/08-wasm/types/client_state_test.go
#	modules/light-clients/08-wasm/types/migrate_contract_test.go
#	modules/light-clients/08-wasm/types/msgs_test.go
#	modules/light-clients/08-wasm/types/types_test.go
#	modules/light-clients/08-wasm/types/validation.go
#	modules/light-clients/08-wasm/types/validation_test.go
#	modules/light-clients/08-wasm/types/vm.go
#	modules/light-clients/08-wasm/types/wasm.go
#	modules/light-clients/08-wasm/types/wasm_test.go
mergify bot pushed a commit that referenced this pull request Nov 20, 2023
* use wasm VM CreateChecksum

* review comments

* lint

* lint 2

* Remove raw calls to sha256, clean up handling of Checksums.

* Update modules/light-clients/08-wasm/keeper/keeper.go

Co-authored-by: Damian Nolan <damiannolan@gmail.com>

* Document this bad boy.

---------

Co-authored-by: DimitrisJim <d.f.hilliard@gmail.com>
Co-authored-by: Damian Nolan <damiannolan@gmail.com>
(cherry picked from commit a231fea)

# Conflicts:
#	modules/light-clients/08-wasm/keeper/events.go
#	modules/light-clients/08-wasm/keeper/genesis.go
#	modules/light-clients/08-wasm/keeper/keeper.go
#	modules/light-clients/08-wasm/keeper/msg_server_test.go
#	modules/light-clients/08-wasm/keeper/snapshotter.go
#	modules/light-clients/08-wasm/keeper/snapshotter_test.go
#	modules/light-clients/08-wasm/testing/mock_engine.go
#	modules/light-clients/08-wasm/testing/values.go
#	modules/light-clients/08-wasm/testing/wasm_endpoint.go
#	modules/light-clients/08-wasm/types/client_state_test.go
#	modules/light-clients/08-wasm/types/migrate_contract_test.go
#	modules/light-clients/08-wasm/types/msgs_test.go
#	modules/light-clients/08-wasm/types/types_test.go
#	modules/light-clients/08-wasm/types/validation.go
#	modules/light-clients/08-wasm/types/validation_test.go
#	modules/light-clients/08-wasm/types/vm.go
#	modules/light-clients/08-wasm/types/wasm.go
#	modules/light-clients/08-wasm/types/wasm_test.go
damiannolan added a commit that referenced this pull request Nov 29, 2023
* imp: use wasm VM CreateChecksum (#5123)

* use wasm VM CreateChecksum

* review comments

* lint

* lint 2

* Remove raw calls to sha256, clean up handling of Checksums.

* Update modules/light-clients/08-wasm/keeper/keeper.go

Co-authored-by: Damian Nolan <damiannolan@gmail.com>

* Document this bad boy.

---------

Co-authored-by: DimitrisJim <d.f.hilliard@gmail.com>
Co-authored-by: Damian Nolan <damiannolan@gmail.com>
(cherry picked from commit a231fea)

# Conflicts:
#	modules/light-clients/08-wasm/keeper/events.go
#	modules/light-clients/08-wasm/keeper/genesis.go
#	modules/light-clients/08-wasm/keeper/keeper.go
#	modules/light-clients/08-wasm/keeper/msg_server_test.go
#	modules/light-clients/08-wasm/keeper/snapshotter.go
#	modules/light-clients/08-wasm/keeper/snapshotter_test.go
#	modules/light-clients/08-wasm/testing/mock_engine.go
#	modules/light-clients/08-wasm/testing/values.go
#	modules/light-clients/08-wasm/testing/wasm_endpoint.go
#	modules/light-clients/08-wasm/types/client_state_test.go
#	modules/light-clients/08-wasm/types/migrate_contract_test.go
#	modules/light-clients/08-wasm/types/msgs_test.go
#	modules/light-clients/08-wasm/types/types_test.go
#	modules/light-clients/08-wasm/types/validation.go
#	modules/light-clients/08-wasm/types/validation_test.go
#	modules/light-clients/08-wasm/types/vm.go
#	modules/light-clients/08-wasm/types/wasm.go
#	modules/light-clients/08-wasm/types/wasm_test.go

* lint: simplify newHash[:] -> newHash to satifsy linting overlords

---------

Co-authored-by: Carlos Rodriguez <carlos@interchain.io>
Co-authored-by: Damian Nolan <damiannolan@gmail.com>
mergify bot pushed a commit that referenced this pull request Nov 29, 2023
* use wasm VM CreateChecksum

* review comments

* lint

* lint 2

* Remove raw calls to sha256, clean up handling of Checksums.

* Update modules/light-clients/08-wasm/keeper/keeper.go

Co-authored-by: Damian Nolan <damiannolan@gmail.com>

* Document this bad boy.

---------

Co-authored-by: DimitrisJim <d.f.hilliard@gmail.com>
Co-authored-by: Damian Nolan <damiannolan@gmail.com>
(cherry picked from commit a231fea)
damiannolan pushed a commit that referenced this pull request Nov 29, 2023
* use wasm VM CreateChecksum

* review comments

* lint

* lint 2

* Remove raw calls to sha256, clean up handling of Checksums.

* Update modules/light-clients/08-wasm/keeper/keeper.go

Co-authored-by: Damian Nolan <damiannolan@gmail.com>

* Document this bad boy.

---------

Co-authored-by: DimitrisJim <d.f.hilliard@gmail.com>
Co-authored-by: Damian Nolan <damiannolan@gmail.com>
(cherry picked from commit a231fea)

Co-authored-by: Carlos Rodriguez <carlos@interchain.io>
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.

Use wasmvm.CreateChecksum instead of duplicating it.
4 participants