Skip to content

Commit

Permalink
nits
Browse files Browse the repository at this point in the history
  • Loading branch information
saketh-are committed Feb 15, 2024
1 parent 6230328 commit f3d26b6
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions examples/mpc-contract/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,16 @@ impl MpcContract {
DATA_ID_REGISTER,
);

// Record the pending request
// Store the request in the contract's local state
let data_id: CryptoHash =
env::read_register(DATA_ID_REGISTER).expect("").try_into().expect("");
self.requests.insert(
&index,
&SignatureRequest { data_id, account_id: env::signer_account_id(), payload },
);

// The return value for this function call will be the value
// returned by the `sign_on_finish` callback.
env::promise_return(promise);
}

Expand All @@ -82,7 +84,7 @@ impl MpcContract {
request_index: u64,
#[callback_result] signature: Result<String, PromiseError>,
) -> Option<String> {
// clean up local state
// Clean up the local state
self.requests.remove(&request_index);

match signature {
Expand Down

0 comments on commit f3d26b6

Please sign in to comment.