// dj tasks for events from Ethereum(web3.js) and Darwinia(polkadot.js)
match (event) {
Some(ethereum_crosschain_receipt_event) => {
if (receipt_block < relay_last_confirmed_block) {
do sign_and_broadcast_to_darwinia(extrinsic(verify_receipt_call))
}
else {
let min_required_relay_confirm_block = receipt_block + 1;
do sign_and_broadcast_to_darwinia(extrinsic(relay_proposal_call))
push ethereum_crosschain_receipt_event
}
},
Some(darwinia_relay_new_round) => {
do sign_and_broadcast_to_darwinia(extrinsic(relay_proposal_call))
},
Some(darwinia_new_pending_block) => {
do sign_and_broadcast_to_darwinia(extrinsic(relay_guard_call))
},
Some(darwinia_ethereum_relay_confirm_event) => {
pull receipt_events from ethereum_crosschain_receipt_event
for (receipt_event in receipt_events) {
do sign_and_broadcast_to_darwinia(extrinsic(verify_receipt_call))
}
}
}
Pseudocode