Skip to content

Commit 8cbde37

Browse files
committed
Show the source file actually used when overriding.
1 parent a11eace commit 8cbde37

1 file changed

Lines changed: 16 additions & 2 deletions

File tree

  • cmd/soroban-cli/src/commands/contract

cmd/soroban-cli/src/commands/contract/verify.rs

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -254,8 +254,22 @@ impl Cmd {
254254
let meta = extract_metadata(&wasm_bytes)?;
255255

256256
print.infoln(format!("Build image: {}", meta.bldimg));
257-
if let Some(v) = &meta.source_uri {
258-
print.infoln(format!("Source URI: {v}"));
257+
// Report the source we'll actually fetch from. When `--source-uri`
258+
// overrides the recorded value, show the override (and the recorded
259+
// value it replaces) so the line isn't misleading.
260+
match (&self.source_uri, &meta.source_uri) {
261+
(Some(override_uri), Some(recorded)) => {
262+
print.infoln(format!(
263+
"Source URI: {override_uri} (overrides recorded {recorded})"
264+
));
265+
}
266+
(Some(override_uri), None) => {
267+
print.infoln(format!("Source URI: {override_uri} (override)"));
268+
}
269+
(None, Some(recorded)) => {
270+
print.infoln(format!("Source URI: {recorded}"));
271+
}
272+
(None, None) => {}
259273
}
260274
if let Some(v) = &meta.source_sha256 {
261275
print.infoln(format!("Source SHA-256: {v}"));

0 commit comments

Comments
 (0)