Skip to content

Commit

Permalink
fix: request-vc in cli with ii and stf fails to decode (#2882)
Browse files Browse the repository at this point in the history
* fix: request-vc in cli with ii and stf fails to decode

* refactor: remove unused import
  • Loading branch information
felixfaisal committed Jul 9, 2024
1 parent d37eea1 commit b3082f7
Showing 1 changed file with 15 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ use litentry_primitives::{
OneBlockCourseType, ParameterString, PlatformUserType, RequestAesKey, SoraQuizType,
VIP3MembershipCardLevel, Web3Network, Web3NftType, Web3TokenType, REQUEST_AES_KEY_LEN,
};
use sp_core::{Pair, H160};
use sp_core::{Pair, H160, H256};

// usage example below
//
Expand Down Expand Up @@ -414,6 +414,8 @@ impl RequestVcCommand {
)
.sign(&KeyPair::Sr25519(Box::new(alice.clone())), nonce, &mrenclave, &shard)
.into_trusted_operation(trusted_cli.direct);

if trusted_cli.direct {
match perform_trusted_operation::<RequestVCResult>(cli, trusted_cli, &top) {
Ok(vc) => {
print_vc(&key, vc);
Expand All @@ -422,7 +424,18 @@ impl RequestVcCommand {
println!("{:?}", e);
},
}
nonce += 1;
} else {
println!("WARNING: This method does not support printing VC, Please use -d for direct invocation to print the VC");
match perform_trusted_operation::<H256>(cli, trusted_cli, &top) {
Ok(block_hash) => {
println!("Request VC Event included in block hash: {:?}", block_hash)
},
Err(e) => {
println!("{:?}", e);
},
}
}
nonce += 1;
});
} else {
let top = TrustedCall::request_batch_vc(
Expand Down

0 comments on commit b3082f7

Please sign in to comment.