Skip to content

Commit

Permalink
Warn about non-verifiable builds.
Browse files Browse the repository at this point in the history
  • Loading branch information
abizjak committed Oct 27, 2023
1 parent a2e522a commit 6d9dd50
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cargo-concordium/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## Unreleased changes

## 3.1.5

- Warn about non-verifiable builds.

## 3.1.4

- Support crate names with uppercase letters.
Expand Down
2 changes: 2 additions & 0 deletions cargo-concordium/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,8 @@ Will print any embedded build information.
- The contract sources must be either available remotely on a package
repository such as [crates.io](https://crates.io) or entirely under the
package root directory.
- The `crypto-primitives` feature is not supported. This feature is only needed
for running tests and can be disabled for a build.

## Locally executing contracts

Expand Down
12 changes: 12 additions & 0 deletions cargo-concordium/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -955,6 +955,7 @@ fn handle_build(
let success_style = ansi_term::Color::Green.bold();
let bold_style = ansi_term::Style::new().bold();
let build_schema = options.schema_build_options();
let is_verifiable_build = options.image.is_some();
let BuildInfo {
total_module_len,
schema,
Expand Down Expand Up @@ -1084,6 +1085,17 @@ fn handle_build(
bold_style.paint(size)
);
}
if !is_verifiable_build {
let error_style = ansi_term::Color::Yellow;
eprintln!(
"{}",
error_style.paint(
"\n\nThis is not a verifiable build. Consider using the `--verifiable` option \
before deploying the module.\n\nA verifiable build packages sources and makes it \
possible to verify that the sources match the deployed module."
)
)
}
Ok(metadata)
}

Expand Down

0 comments on commit 6d9dd50

Please sign in to comment.