Skip to content

Commit cb5c5bf

Browse files
authored
Merge pull request #178 from hirosystems/chore/clarity-repl-v0.18.0
Compatibility with clarity-repl v0.17.0+
2 parents 29bbcc0 + 664ecc4 commit cb5c5bf

File tree

3 files changed

+27
-12
lines changed

3 files changed

+27
-12
lines changed

Cargo.lock

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ deno_core = { path = "./vendor/deno/core", optional = true }
2626
deno_runtime = { path = "./vendor/deno/runtime", optional = true }
2727
deno = { path = "./vendor/deno/cli", optional = true }
2828
# clarity_repl = { package = "clarity-repl", path = "../../clarity-repl", features = ["cli"] }
29-
clarity_repl = { package = "clarity-repl", version = "=0.16.0" }
29+
clarity_repl = { package = "clarity-repl", version = "=0.17.0" }
3030
bip39 = { version = "1.0.1", default-features = false }
3131
aes = "0.6.0"
3232
base64 = "0.13.0"

src/runnner/deno.rs

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1213,7 +1213,11 @@ fn mine_block(state: &mut OpState, args: Value, _: ()) -> Result<String, AnyErro
12131213
continue;
12141214
}
12151215
};
1216-
receipts.push((execution.result, execution.events));
1216+
let result = match execution.result {
1217+
Some(output) => format!("{}", output),
1218+
_ => unreachable!("Value empty"),
1219+
};
1220+
receipts.push((result, execution.events));
12171221
} else {
12181222
session.set_tx_sender(tx.sender.clone());
12191223
if let Some(ref args) = tx.deploy_contract {
@@ -1225,7 +1229,11 @@ fn mine_block(state: &mut OpState, args: Value, _: ()) -> Result<String, AnyErro
12251229
Some(name.into()),
12261230
)
12271231
.unwrap(); // todo(ludo)
1228-
receipts.push((execution.result, execution.events));
1232+
let result = match execution.result {
1233+
Some(output) => format!("{}", output),
1234+
_ => unreachable!("Value empty"),
1235+
};
1236+
receipts.push((result, execution.events));
12291237
} else if let Some(ref args) = tx.transfer_stx {
12301238
let snippet = format!(
12311239
"(stx-transfer? u{} tx-sender '{})",
@@ -1234,7 +1242,11 @@ fn mine_block(state: &mut OpState, args: Value, _: ()) -> Result<String, AnyErro
12341242
let execution = session
12351243
.interpret(snippet, None, true, Some(name.into()))
12361244
.unwrap(); // todo(ludo)
1237-
receipts.push((execution.result, execution.events));
1245+
let result = match execution.result {
1246+
Some(output) => format!("{}", output),
1247+
_ => unreachable!("Value empty"),
1248+
};
1249+
receipts.push((result, execution.events));
12381250
}
12391251
session.set_tx_sender(initial_tx_sender.clone());
12401252
}
@@ -1302,8 +1314,11 @@ fn call_read_only_fn(state: &mut OpState, args: Value, _: ()) -> Result<String,
13021314
"readonly-calls".into(),
13031315
)
13041316
.unwrap(); // todo(ludo)
1305-
1306-
Ok((execution.result, execution.events))
1317+
let result = match execution.result {
1318+
Some(output) => format!("{}", output),
1319+
_ => unreachable!("Value empty"),
1320+
};
1321+
Ok((result, execution.events))
13071322
})?;
13081323
Ok(json!({
13091324
"session_id": args.session_id,

0 commit comments

Comments
 (0)