Skip to content

Commit

Permalink
Fix json rpc sample generation (MystenLabs#3595)
Browse files Browse the repository at this point in the history
  • Loading branch information
patrickkuo authored Jul 29, 2022
1 parent 5d12493 commit 240e940
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion crates/sui-open-rpc/src/generate_json_rpc_spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,7 @@ async fn create_error_response(
let signature = context
.keystore
.sign(&address, &response.tx_bytes.to_vec()?)?;
let flag_bytes = Base64::encode(&[signature.flag_byte()]);
let signature_byte = Base64::encode(signature.signature_bytes());
let pub_key = Base64::encode(signature.public_key_bytes());
let tx_data = response.tx_bytes.encoded();
Expand All @@ -345,8 +346,9 @@ async fn create_error_response(
.method(Method::POST)
.header("Content-Type", "application/json")
.body(Body::from(format!(
"{{ \"jsonrpc\": \"2.0\",\"method\": \"sui_executeTransaction\",\"params\": [\"{}\", \"{}\", \"{}\"],\"id\": 1 }}",
"{{ \"jsonrpc\": \"2.0\",\"method\": \"sui_executeTransaction\",\"params\": [\"{}\", \"{}\", \"{}\", \"{}\"],\"id\": 1 }}",
tx_data,
flag_bytes,
signature_byte,
pub_key
)))?;
Expand Down

0 comments on commit 240e940

Please sign in to comment.