roller: add support for forced transactions
^- (unit @ud)
?~ nonce=(~(get by params) 'nonce') ~
(ni u.nonce)
+ ::
+ ++ force
+ |= params=(map @t json)
+ ^- (unit ?)
+ ?~ force=(~(get by params) 'force') ~
+ (bo u.force)
--
::
++ to-json
++ process-rpc
|= [id=@t params=(map @t json) action=l2-tx over-quota=$-(@p ?)]
^- [(unit cage) response:rpc]
- ?. =((lent ~(tap by params)) 4)
+ ?. =((lent ~(tap by params)) 5)
[~ ~(params error:json-rpc id)]
=+ ^- $: sig=(unit @)
from=(unit [=ship proxy:naive])
addr=(unit @ux)
+ force=(unit ?)
==
=, from-json
- [(sig params) (from params) (address params)]
- ?: |(?=(~ sig) ?=(~ from) ?=(~ addr))
+ [(sig params) (from params) (address params) (force params)]
+ ?: |(?=(~ sig) ?=(~ from) ?=(~ addr) ?=(~ force))
[~ ~(parse error:json-rpc id)]
?: (over-quota ship.u.from)
`[%error id '-32002' 'Max tx quota exceeded']
=+ (gen-tx-octs:lib u.tx)
:_ [%result id (hex:to-json 32 (hash-tx:lib p q))]
%- some
- roller-action+!>([%submit | u.addr u.sig %don u.tx])
+ roller-action+!>([%submit u.force u.addr u.sig %don u.tx])
::
++ nonce
|= [id=@t params=(map @t json) scry=$-([ship proxy:naive] (unit @))]
