mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-12-24 15:34:10 +03:00
WIP: return txid in %raw-tx
This commit is contained in:
parent
484e4cc1f8
commit
1a972b1a97
@ -164,7 +164,7 @@
|
|||||||
[%raw-tx @ *]
|
[%raw-tx @ *]
|
||||||
?> ?=([%get-raw-tx *] resp)
|
?> ?=([%get-raw-tx *] resp)
|
||||||
:_ state
|
:_ state
|
||||||
~[(send-update [%.y (get-req-id wire) %raw-tx rawtx.resp])]
|
~[(send-update [%.y (get-req-id wire) %raw-tx +.resp])]
|
||||||
::
|
::
|
||||||
[%ping @ *]
|
[%ping @ *]
|
||||||
?> ?=([%get-block-and-fee *] resp)
|
?> ?=([%get-block-and-fee *] resp)
|
||||||
|
@ -33,7 +33,6 @@
|
|||||||
def-wallet=(unit xpub)
|
def-wallet=(unit xpub)
|
||||||
moon-limit=@ud
|
moon-limit=@ud
|
||||||
=pend-addr
|
=pend-addr
|
||||||
=pend-txbu
|
|
||||||
=piym
|
=piym
|
||||||
=poym
|
=poym
|
||||||
=piym-watch
|
=piym-watch
|
||||||
@ -191,6 +190,7 @@
|
|||||||
==
|
==
|
||||||
::
|
::
|
||||||
%raw-tx
|
%raw-tx
|
||||||
|
:: TODO: check whether in poym
|
||||||
~& >> rawtx.body.p.upd
|
~& >> rawtx.body.p.upd
|
||||||
`state
|
`state
|
||||||
==
|
==
|
||||||
@ -225,10 +225,11 @@
|
|||||||
:: txbus can potentially use the same UTXO inputs, so if another payment
|
:: txbus can potentially use the same UTXO inputs, so if another payment
|
||||||
:: was in process of fetching raw-txs for a txbu, replace it
|
:: was in process of fetching raw-txs for a txbu, replace it
|
||||||
::
|
::
|
||||||
=/ ri=req-id:bp (gen-req-id:bp eny.bowl)
|
=/ txids=(list txid)
|
||||||
:_ state(poym [ri payee.upd txbu.upd])
|
%+ turn txis.txbu.upd
|
||||||
|
|= =txi:bws txid.utxo.txi
|
||||||
|
:_ state(poym [payee.upd txbu.upd])
|
||||||
:: TODO: send all its input tx-ids out for feedback
|
:: TODO: send all its input tx-ids out for feedback
|
||||||
~
|
|
||||||
::
|
::
|
||||||
%scan-done
|
%scan-done
|
||||||
?~ def-wallet
|
?~ def-wallet
|
||||||
@ -269,11 +270,20 @@
|
|||||||
(get-address-info ri host.u.provider a.req)
|
(get-address-info ri host.u.provider a.req)
|
||||||
::
|
::
|
||||||
++ get-address-info
|
++ get-address-info
|
||||||
|= [ri=req-id:bp host=ship a=address] ^- card
|
|= [ri=req-id:bp host=ship a=address]
|
||||||
|
^- card
|
||||||
:* %pass /[(scot %da now.bowl)] %agent [host %btc-provider]
|
:* %pass /[(scot %da now.bowl)] %agent [host %btc-provider]
|
||||||
%poke %btc-provider-action !>([ri %address-info a])
|
%poke %btc-provider-action !>([ri %address-info a])
|
||||||
==
|
==
|
||||||
::
|
::
|
||||||
|
++ get-raw-tx
|
||||||
|
|= [host=ship =txid]
|
||||||
|
^- card
|
||||||
|
=/ ri=req-id:bp (gen-req-id:bp eny.bowl)
|
||||||
|
:* %pass /[(scot %da now.bowl)] %agent [host %btc-provider]
|
||||||
|
%poke %btc-provider-action !>(ri %raw-tx txid)
|
||||||
|
==
|
||||||
|
::
|
||||||
++ provider-connected
|
++ provider-connected
|
||||||
^- ?
|
^- ?
|
||||||
?~ provider %.n
|
?~ provider %.n
|
||||||
|
@ -95,7 +95,10 @@
|
|||||||
[%value ni:dejs:format]
|
[%value ni:dejs:format]
|
||||||
==
|
==
|
||||||
++ raw-tx
|
++ raw-tx
|
||||||
(cu:dejs:format to-btc-byts so:dejs:format)
|
%- ot:dejs:format
|
||||||
|
:~ [%txid (cu:dejs:format to-hash256 so:dejs:format)]
|
||||||
|
[%rawtx (cu:dejs:format to-btc-byts so:dejs:format)]
|
||||||
|
==
|
||||||
++ block-and-fee
|
++ block-and-fee
|
||||||
%- ot:dejs:format
|
%- ot:dejs:format
|
||||||
:~ [%blockcount ni:dejs:format]
|
:~ [%blockcount ni:dejs:format]
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
+$ result [=req-id body=result-body]
|
+$ result [=req-id body=result-body]
|
||||||
+$ result-body
|
+$ result-body
|
||||||
$% [%address-info utxos=(set utxo) used=? blockcount=@ud]
|
$% [%address-info utxos=(set utxo) used=? blockcount=@ud]
|
||||||
[%raw-tx =rawtx]
|
[%raw-tx =txid =rawtx]
|
||||||
==
|
==
|
||||||
+$ error
|
+$ error
|
||||||
$% [%not-connected status=@ud]
|
$% [%not-connected status=@ud]
|
||||||
@ -41,7 +41,7 @@
|
|||||||
::
|
::
|
||||||
+$ response
|
+$ response
|
||||||
$% [%get-address-info utxos=(set utxo) used=? blockcount=@ud]
|
$% [%get-address-info utxos=(set utxo) used=? blockcount=@ud]
|
||||||
[%get-raw-tx =rawtx]
|
[%get-raw-tx =txid =rawtx]
|
||||||
[%get-block-count blockcount=@ud]
|
[%get-block-count blockcount=@ud]
|
||||||
[%get-block-and-fee blockcount=@ud fee=sats]
|
[%get-block-and-fee blockcount=@ud fee=sats]
|
||||||
==
|
==
|
||||||
|
@ -2,7 +2,6 @@
|
|||||||
|%
|
|%
|
||||||
:: req-id: hash of [xpub chyg idx]
|
:: req-id: hash of [xpub chyg idx]
|
||||||
:: pend: lookup of req-id -> requests from wallet-store
|
:: pend: lookup of req-id -> requests from wallet-store
|
||||||
:: pend-txbu: lookup req-id -> txbu (to fetch and assoc rawtx info with txid)
|
|
||||||
::
|
::
|
||||||
:: payment: a payment expected from another ship
|
:: payment: a payment expected from another ship
|
||||||
:: - address: address generated for this payment
|
:: - address: address generated for this payment
|
||||||
@ -14,12 +13,11 @@
|
|||||||
::
|
::
|
||||||
+$ btc-state [blockcount=@ud fee=sats t=@da]
|
+$ btc-state [blockcount=@ud fee=sats t=@da]
|
||||||
+$ pend-addr (map req-id:bp request:bws)
|
+$ pend-addr (map req-id:bp request:bws)
|
||||||
+$ pend-txbu (map req-id:bp ship)
|
|
||||||
::
|
::
|
||||||
+$ payment [=address payer=ship value=sats]
|
+$ payment [=address payer=ship value=sats]
|
||||||
::
|
::
|
||||||
+$ piym (jar ship payment)
|
+$ piym (jar ship payment)
|
||||||
+$ poym [=req-id:bp payee=(unit ship) =txbu:bws]
|
+$ poym [payee=(unit ship) =txbu]
|
||||||
+$ piym-watch (map address ship)
|
+$ piym-watch (map address ship)
|
||||||
+$ poym-watch (map address ship)
|
+$ poym-watch (map address ship)
|
||||||
::
|
::
|
||||||
|
Loading…
Reference in New Issue
Block a user