File tree Expand file tree Collapse file tree 1 file changed +2
-3
lines changed
frame/examples/offchain-worker/src Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Original file line number Diff line number Diff line change @@ -410,15 +410,14 @@ impl<T: Config> Pallet<T> {
410
410
match res {
411
411
// The value has been set correctly, which means we can safely send a transaction now.
412
412
Ok ( block_number) => {
413
- // Depending if the block is even or odd we will send a `Signed` or `Unsigned`
414
- // transaction.
413
+ // We will send different transactions based on a random number.
415
414
// Note that this logic doesn't really guarantee that the transactions will be sent
416
415
// in an alternating fashion (i.e. fairly distributed). Depending on the execution
417
416
// order and lock acquisition, we may end up for instance sending two `Signed`
418
417
// transactions in a row. If a strict order is desired, it's better to use
419
418
// the storage entry for that. (for instance store both block number and a flag
420
419
// indicating the type of next transaction to send).
421
- let transaction_type = block_number % 3u32 . into ( ) ;
420
+ let transaction_type = block_number % 4u32 . into ( ) ;
422
421
if transaction_type == Zero :: zero ( ) {
423
422
TransactionType :: Signed
424
423
} else if transaction_type == T :: BlockNumber :: from ( 1u32 ) {
You can’t perform that action at this time.
0 commit comments