Skip to content

Commit 3129c2f

Browse files
committed
Add comments for register SP parser API call.
Signed-off-by: Sergey Minaev <[email protected]>
1 parent 1b16f47 commit 3129c2f

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

libindy/src/api/ledger.rs

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1618,9 +1618,36 @@ pub extern fn indy_parse_get_revoc_reg_delta_response(command_handle: i32,
16181618
res
16191619
}
16201620

1621+
/// Callback type for parsing Reply from Node to specific StateProof format
1622+
///
1623+
/// # params
1624+
/// reply_from_node: string representation of node's reply ("as is")
1625+
/// parsed_sp: out param to return serialized as string JSON with array of ParsedSP
1626+
///
1627+
/// # return
1628+
/// result ErrorCode
1629+
///
1630+
/// Note: this method allocate memory for result string `CustomFree` should be called to deallocate it
16211631
pub type CustomTransactionParser = extern fn(reply_from_node: *const c_char, parsed_sp: *mut *const c_char) -> ErrorCode;
1632+
1633+
/// Callback type to deallocate result buffer `parsed_sp` from `CustomTransactionParser`
16221634
pub type CustomFree = extern fn(data: *const c_char) -> ErrorCode;
16231635

1636+
1637+
/// Register callbacks (see type description for `CustomTransactionParser` and `CustomFree`
1638+
///
1639+
/// # params
1640+
/// command_handle: command handle to map callback to caller context.
1641+
/// txn_type: type of transaction to apply `parse` callback.
1642+
/// parse: required callback to parse reply for state proof.
1643+
/// free: required callback to deallocate memory.
1644+
/// cb: Callback that takes command result as parameter.
1645+
///
1646+
/// # returns
1647+
/// Status of callbacks registration.
1648+
///
1649+
/// # errors
1650+
/// Common*
16241651
#[no_mangle]
16251652
pub extern fn indy_register_transaction_parser_for_sp(command_handle: i32,
16261653
txn_type: *const c_char,

0 commit comments

Comments
 (0)