Skip to content

Commit

Permalink
Merge pull request #106 from Vsc-blockchain/v0.2.9-vsg
Browse files Browse the repository at this point in the history
fix: ungraceful exit of init_client()

Signed-off-by: Jun Kimura <[email protected]>
  • Loading branch information
bluele authored Jul 15, 2024
2 parents 8934493 + 42f1d0b commit 812fab0
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@ pub fn init_client<R: LightClientResolver, S: KVStore, K: Signer>(

let any_client_state: Any = input.any_client_state.into();
let any_consensus_state: Any = input.any_consensus_state.into();
let lc = ctx.get_light_client(&any_client_state.type_url).unwrap();
let lc = match ctx.get_light_client(&any_client_state.type_url) {
Some(lc) => lc,
None => return Err(Error::invalid_argument(any_client_state.type_url.clone())),
};
let ek = ctx.get_enclave_key();
let res = lc.create_client(ctx, any_client_state.clone(), any_consensus_state.clone())?;
let client_type = lc.client_type();
Expand Down

0 comments on commit 812fab0

Please sign in to comment.