Skip to content
This repository has been archived by the owner on Jun 24, 2024. It is now read-only.

Commit

Permalink
rpc method for commitmentPrefix
Browse files Browse the repository at this point in the history
  • Loading branch information
rnbguy committed Jun 6, 2024
1 parent 367a176 commit 48f5c7d
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions modules/sov-ibc/src/rpc/methods.rs
Original file line number Diff line number Diff line change
Expand Up @@ -711,4 +711,15 @@ impl<S: Spec> Ibc<S> {
proof_height,
))
}

#[rpc_method(name = "commitmentPrefix")]
pub fn commitment_prefix(&self, working_set: &mut WorkingSet<S>) -> RpcResult<String> {
let ibc_ctx = IbcContext::new(self, Rc::new(RefCell::new(working_set)));

let commitment_prefix = ibc_ctx.commitment_prefix();

let base64_commitment_prefix = hex::encode(commitment_prefix.as_bytes());

Ok(base64_commitment_prefix)
}
}

0 comments on commit 48f5c7d

Please sign in to comment.