mirror of
https://github.com/urbit/shrub.git
synced 2024-12-24 11:24:21 +03:00
roller-rpc: fix serializing tx for personal_sign
This commit is contained in:
parent
502fd5822b
commit
084c70497d
@ -175,9 +175,9 @@
|
|||||||
%get-unsigned-tx `(hash-transaction id +.params chain:scry & |)
|
%get-unsigned-tx `(hash-transaction id +.params chain:scry & |)
|
||||||
%get-predicted-state `(get-naive id +.params predicted:scry)
|
%get-predicted-state `(get-naive id +.params predicted:scry)
|
||||||
%hash-raw-transaction `(hash-raw-transaction id +.params)
|
%hash-raw-transaction `(hash-raw-transaction id +.params)
|
||||||
:: TODO: deprecated, remove
|
:: TODO: deprecated, remove (used together with personal_sign)
|
||||||
::
|
::
|
||||||
%hash-transaction `(hash-transaction id +.params chain:scry & |)
|
%hash-transaction `(hash-transaction id +.params chain:scry | &)
|
||||||
==
|
==
|
||||||
--
|
--
|
||||||
::
|
::
|
||||||
|
@ -620,17 +620,16 @@
|
|||||||
~(parse error:json-rpc id)
|
~(parse error:json-rpc id)
|
||||||
=/ tx=(unit tx:naive) (build-l2-tx u.l2-tx u.from params)
|
=/ tx=(unit tx:naive) (build-l2-tx u.l2-tx u.from params)
|
||||||
?~ tx ~(parse error:json-rpc id)
|
?~ tx ~(parse error:json-rpc id)
|
||||||
=/ =octs (gen-tx-octs:lib u.tx)
|
=/ =octs
|
||||||
|
%. [chain-id u.nonce (gen-tx-octs:lib u.tx)]
|
||||||
|
?: header
|
||||||
|
unsigned-tx:lib
|
||||||
|
prepare-for-sig:lib
|
||||||
:+ %result id
|
:+ %result id
|
||||||
=; =keccak
|
%- hex:to-json
|
||||||
%+ hex:to-json 32
|
?: reverse
|
||||||
?. reverse keccak
|
p.octs^(rev 3 octs)
|
||||||
(reverse-hash:lib keccak)
|
32^(hash-tx:lib octs)
|
||||||
%- hash-tx:lib
|
|
||||||
%. [chain-id u.nonce octs]
|
|
||||||
?: header
|
|
||||||
unsigned-tx:lib
|
|
||||||
prepare-for-sig:lib
|
|
||||||
::
|
::
|
||||||
++ hash-raw-transaction
|
++ hash-raw-transaction
|
||||||
|= [id=@t params=(map @t json)]
|
|= [id=@t params=(map @t json)]
|
||||||
|
Loading…
Reference in New Issue
Block a user