I have an offchain worker which does various things offline and then calls an online extrinsic.

Here's the line where I call the extrinsic from the offchain worker:

        let result = signer.send_unsigned_transaction(
            |account| IpfsAddressPayload { block_number, address: address.clone(), public: account.public.clone() },
            |payload, signature| Call::invalidate_consequence {
                address_payload: payload,

I've been doing some testing and hacked my extrinsic so that it always fails, to make sure the offchain worker behaves properly.

However, I noticed that, as long as the signer is able to sign and the transaction is successfully sent, the result is Some((_, Ok())), even when the extrinsic fails.

I was expecting to get Some((_,Err())), if the extrinsic fails.

Now I think about it, the more it makes sense to return Some((_, Ok())), afterall the offchain worker doesn't wait for the extrinsic to execute.

So I'm assuming that my offchain worker can never know whether the extrinsic it called failed or not, just whether it successfully called it.

Have I reached the right conclusion there or should I expect my offchain worker to be able to know whether the extrinsic it called failed or not?


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.