mirror of
https://github.com/urbit/shrub.git
synced 2024-12-24 03:14:30 +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-predicted-state `(get-naive id +.params predicted:scry)
|
||||
%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)
|
||||
=/ tx=(unit tx:naive) (build-l2-tx u.l2-tx u.from params)
|
||||
?~ tx ~(parse error:json-rpc id)
|
||||
=/ =octs (gen-tx-octs:lib u.tx)
|
||||
:+ %result id
|
||||
=; =keccak
|
||||
%+ hex:to-json 32
|
||||
?. reverse keccak
|
||||
(reverse-hash:lib keccak)
|
||||
%- hash-tx:lib
|
||||
%. [chain-id u.nonce octs]
|
||||
=/ =octs
|
||||
%. [chain-id u.nonce (gen-tx-octs:lib u.tx)]
|
||||
?: header
|
||||
unsigned-tx:lib
|
||||
prepare-for-sig:lib
|
||||
:+ %result id
|
||||
%- hex:to-json
|
||||
?: reverse
|
||||
p.octs^(rev 3 octs)
|
||||
32^(hash-tx:lib octs)
|
||||
::
|
||||
++ hash-raw-transaction
|
||||
|= [id=@t params=(map @t json)]
|
||||
|
Loading…
Reference in New Issue
Block a user