Skip to content

Commit

Permalink
Add verify command (#1306)
Browse files Browse the repository at this point in the history
* Add skeleton of `Verify` command

* Read `BuildInfo` from contract metadata

* Manually build contract using `BuildInfo`

* Check built Wasm file against that in the reference metadata

* Comopare `SourceWasm`'s instead of byte strings

* Check that current `nightly` matches that from contract

* Switch from `env_logger` to `tracing`

* Use helper function to get current Rust toolchain

* Clean up docs a little

* Bail out if `wasm-opt` versions don't match

This should maybe be a warning instead of an error, but I'll need
to experiment with this more.

* Use stable `rustc` toolchain

* Use `keep_debug_symbols` from metadata

* Make output more colourful

* Add missing doc comment

* Do a better job of error handling

* Add more error handling improvements

* Add `CHANGELOG` entry

* Appease Clippy

* Use updated Rust toolchain build info

* Apply fixes for `clap` `v4.0`

* Compare `cargo-contract` versions instead of `wasm-opt` versions

Since releases of `cargo-contract` are now bundled with a `wasm-opt`
library we can assume that equal versions of `cargo-contract` contain
equal versions of `wasm-opt`.

* update code

* add docker support

* remove docker flag

* fix error message

* display paths of the contracts

* fix changelog

* fix file header

* apply review suggestions

* prettify code hash output

* add integration tests

---------

Co-authored-by: Hernando Castano <hernando@hcastano.com>
  • Loading branch information
German and HCastano authored Sep 1, 2023
1 parent 11222f3 commit b731f54
Show file tree
Hide file tree
Showing 11 changed files with 1,021 additions and 538 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Added
- Adds workflow for publishing docker images for the verifiable builds - [#1267](https://github.com/paritytech/cargo-contract/pull/1267)
- Add `verify` command - [#1306](https://github.com/paritytech/cargo-contract/pull/1306)

## [4.0.0-alpha]

Expand Down
Loading

0 comments on commit b731f54

Please sign in to comment.