diff --git a/pkg/arvo/app/roller-rpc.hoon b/pkg/arvo/app/roller-rpc.hoon index 43c5643523..b741c15c75 100644 --- a/pkg/arvo/app/roller-rpc.hoon +++ b/pkg/arvo/app/roller-rpc.hoon @@ -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) == -- diff --git a/pkg/arvo/lib/azimuth-roll-rpc.hoon b/pkg/arvo/lib/azimuth-roll-rpc.hoon index 88caa803e5..f46ff6e7ec 100644 --- a/pkg/arvo/lib/azimuth-roll-rpc.hoon +++ b/pkg/arvo/lib/azimuth-roll-rpc.hoon @@ -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] diff --git a/pkg/arvo/lib/naive-transactions.hoon b/pkg/arvo/lib/naive-transactions.hoon index 7e92947e91..e85deb03eb 100644 --- a/pkg/arvo/lib/naive-transactions.hoon +++ b/pkg/arvo/lib/naive-transactions.hoon @@ -203,6 +203,11 @@ :: -- :: +++ reverse-hash + |= keccak=@ux + ^+ keccak + (rev 3 (met 3 keccak) keccak) +:: ++ hash-tx keccak-256:keccak:crypto :: ++ hash-raw-tx