mirror of
https://github.com/urbit/shrub.git
synced 2024-12-19 00:13:12 +03:00
roller: wip support for metamask personal_sign
This commit is contained in:
parent
07d5ddfe0c
commit
aabf028b89
@ -166,7 +166,8 @@
|
||||
%get-nonce `(nonce id +.params nonce:scry)
|
||||
%get-history `(history id +.params addr:history:scry)
|
||||
%get-roller-config `(get-config id +.params config:scry)
|
||||
%hash-transaction `(hash-transaction id +.params chain-id:scry)
|
||||
%hash-transaction `(hash-transaction id +.params chain-id:scry | &)
|
||||
%unsign-transaction `(hash-transaction id +.params chain-id:scry & |)
|
||||
%get-predicted-state `(get-naive id +.params predicted:scry)
|
||||
==
|
||||
--
|
||||
|
@ -585,7 +585,7 @@
|
||||
[%result id (config:to-json roller-config)]
|
||||
::
|
||||
++ hash-transaction
|
||||
|= [id=@t params=(map @t json) chain-id=@]
|
||||
|= [id=@t params=(map @t json) chain-id=@ header=? reverse=?]
|
||||
^- response:rpc
|
||||
?. =((lent ~(tap by params)) 4)
|
||||
~(params error:json-rpc id)
|
||||
@ -599,9 +599,17 @@
|
||||
~(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
|
||||
=- (hex:to-json 32 (hash-tx:lib p q))
|
||||
(unsigned-tx:lib chain-id u.nonce (gen-tx-octs:lib u.tx))
|
||||
=; =keccak
|
||||
%+ hex:to-json 32
|
||||
?. reverse keccak
|
||||
(reverse-hash:lib keccak)
|
||||
%- hash-tx:lib
|
||||
%. [chain-id u.nonce octs]
|
||||
?: header
|
||||
unsigned-tx:lib
|
||||
prepare-for-sig:lib
|
||||
::
|
||||
++ get-naive
|
||||
|= [id=@t params=(map @t json) =^state:naive]
|
||||
|
@ -203,6 +203,11 @@
|
||||
::
|
||||
--
|
||||
::
|
||||
++ reverse-hash
|
||||
|= keccak=@ux
|
||||
^+ keccak
|
||||
(rev 3 (met 3 keccak) keccak)
|
||||
::
|
||||
++ hash-tx keccak-256:keccak:crypto
|
||||
::
|
||||
++ hash-raw-tx
|
||||
|
Loading…
Reference in New Issue
Block a user