Skip to content

Commit e74a82a

Browse files
committed
Update and clean-up state proof logic for revocation transactions.
Signed-off-by: Sergey Minaev <[email protected]>
1 parent 3b37042 commit e74a82a

File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
lines changed

libindy/src/errors/wallet.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ impl ToErrorCode for WalletError {
9292

9393
impl From<io::Error> for WalletError {
9494
fn from(err: io::Error) -> WalletError {
95-
WalletError::CommonError(CommonError::IOError((err)))
95+
WalletError::CommonError(CommonError::IOError(err))
9696
}
9797
}
9898

libindy/src/services/pool/transaction_handler.rs

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ use self::indy_crypto::bls::Generator;
3232
const REQUESTS_FOR_STATE_PROOFS: [&'static str; 7] = [
3333
constants::GET_NYM,
3434
constants::GET_SCHEMA,
35-
constants::GET_CLAIM_DEF,
35+
constants::GET_CRED_DEF,
3636
constants::GET_ATTR,
3737
constants::GET_REVOC_REG,
3838
constants::GET_REVOC_REG_DEF,
@@ -360,34 +360,36 @@ impl TransactionHandler {
360360
parsed_data["revocDefType"].as_str(),
361361
parsed_data["tag"].as_str()) {
362362
trace!("TransactionHandler::parse_reply_for_proof_checking: GET_REVOC_REG_DEF cred_def_id {:?}, revoc_def_type: {:?}, tag: {:?}", cred_def_id, revoc_def_type, tag);
363-
format!(":\x04:{}:{}:{}", cred_def_id, revoc_def_type, tag)
363+
format!(":4:{}:{}:{}", cred_def_id, revoc_def_type, tag)
364364
} else {
365365
trace!("TransactionHandler::parse_reply_for_proof_checking: <<< GET_REVOC_REG_DEF No key suffix");
366366
return None;
367367
}
368368
}
369-
constants::GET_REVOC_REG => {
369+
constants::GET_REVOC_REG | constants::GET_REVOC_REG_DELTA if parsed_data["value"]["accum_from"].is_null() => {
370370
//{MARKER}:{REVOC_REG_DEF_ID}
371371
if let Some(revoc_reg_def_id) = parsed_data["revocRegDefId"].as_str() {
372372
trace!("TransactionHandler::parse_reply_for_proof_checking: GET_REVOC_REG revoc_reg_def_id {:?}", revoc_reg_def_id);
373-
format!("\x05:{}", revoc_reg_def_id)
373+
format!("5:{}", revoc_reg_def_id)
374374
} else {
375375
trace!("TransactionHandler::parse_reply_for_proof_checking: <<< GET_REVOC_REG No key suffix");
376376
return None;
377377
}
378378
}
379-
constants::GET_REVOC_REG_DELTA => {
379+
/* TODO add multiproof checking and external verification of indexes
380+
constants::GET_REVOC_REG_DELTA if !parsed_data["value"]["accum_from"].is_null() => {
380381
//{MARKER}:{REVOC_REG_DEF_ID}
381382
if let Some(revoc_reg_def_id) = parsed_data["value"]["accum_to"]["revocRegDefId"].as_str() {
382383
trace!("TransactionHandler::parse_reply_for_proof_checking: GET_REVOC_REG_DELTA revoc_reg_def_id {:?}", revoc_reg_def_id);
383-
format!("\x06:{}", revoc_reg_def_id)
384+
format!("6:{}", revoc_reg_def_id)
384385
} else {
385386
trace!("TransactionHandler::parse_reply_for_proof_checking: <<< GET_REVOC_REG_DELTA No key suffix");
386387
return None;
387388
}
388389
}
390+
*/
389391
_ => {
390-
trace!("TransactionHandler::parse_reply_for_proof_checking: <<< Unknown transaction");
392+
trace!("TransactionHandler::parse_reply_for_proof_checking: <<< Unsupported transaction");
391393
return None;
392394
}
393395
};
@@ -467,7 +469,7 @@ impl TransactionHandler {
467469
hasher.process(data.as_bytes());
468470
value["val"] = SJsonValue::String(hasher.fixed_result().to_hex());
469471
}
470-
constants::GET_CLAIM_DEF | constants::GET_REVOC_REG_DEF | constants::GET_REVOC_REG => {
472+
constants::GET_CRED_DEF | constants::GET_REVOC_REG_DEF | constants::GET_REVOC_REG => {
471473
value["val"] = parsed_data;
472474
}
473475
constants::GET_SCHEMA => {

0 commit comments

Comments
 (0)