validate_apply_transfer
Validates that the parameters are correct for an apply_transfer operation. Also used in other operations that require the same validation to occur (e.g. cancel_transfer) It does not verify whether the transfer expired.
Among other things, this function validates that:
Transfer was not already applied on this chain
Transfer was not already canceled on this chain
Transfer was not already unapplied on this chain
That the
init_transferdetails are correctThe
iccf_proofthat states that this transfer was applied on the previous hop
Throws "INVALID TRANSACTION" if the transfer has already been applied, canceled or unapplied on this chain.
Throws "INPUT ERROR" if the input is malformed. Common scenarios include:
arguments found in
init_transfer_txandprevious_hop_txdo not matchhop_indexis out of boundsprevious_hop_txhas not been sent to the chain that comes before this one on the transfer hops
Throws "WRONG BLOCKCHAIN" if the chain at hop_index on the init transaction is not this chain
Throws if the op_index does not point to apply_transfer
Throws if the init_tx_op_index does not point to init_transfer on its init_transfer_tx
Throws if the operation preceding init_transfer is not an auth operation
Throws if the transaction is missing the iccf_proof operation, which demonstrates that the block containing the previous_hop_tx has been anchored from the previous chain.
Parameters
the init transaction, which contains init_transfer, as it was submitted to the starting chain
the index of the init_transfer operation in init_transfer_tx
the transaction that applied the transfer in the chain that comes before this one. Same as init_transfer_tx if this is the first chain where the transfer is applied.
the index of the apply_transfer operation in previous_hop_tx
which index in the hops array provided in the original transaction this chain represents.
See also
for information on auth operations