mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-12-12 15:01:38 +03:00
support for only doing witness part
This commit is contained in:
parent
741093a588
commit
6a4ebcf239
@ -108,7 +108,7 @@
|
||||
=/ outs=(list out:psbt:btc)
|
||||
%+ turn txos.t
|
||||
|=(=txo [address.txo hk.txo])
|
||||
`(encode:pbt:btc get-rawtx get-txid ins outs)
|
||||
`(encode:pbt:btc %.y get-rawtx get-txid ins outs)
|
||||
--
|
||||
:: wad: door for processing walts (wallets)
|
||||
:: parameterized on a walt and it's chyg account
|
||||
|
17
lib/btc.hoon
17
lib/btc.hoon
@ -193,10 +193,12 @@
|
||||
==
|
||||
::
|
||||
++ input
|
||||
|= i=in:psbt
|
||||
|= [only-witness=? i=in:psbt]
|
||||
^- map:psbt
|
||||
:~ [[1 0x0] rawtx.i]
|
||||
(witness-tx i)
|
||||
%+ weld
|
||||
?: only-witness ~
|
||||
~[[1^0x0 rawtx.i]]
|
||||
:~ (witness-tx i)
|
||||
(hdkey %input hdkey.i)
|
||||
==
|
||||
::
|
||||
@ -262,9 +264,14 @@
|
||||
%- en:base64:mimes:html
|
||||
(flip:byt b)
|
||||
:: +encode: make base64 cord of PSBT
|
||||
:: - only-witness: don't include non-witness UTXO
|
||||
::
|
||||
++ encode
|
||||
|= [=rawtx =txid inputs=(list in:psbt) outputs=(list out:psbt)]
|
||||
|= $: only-witness=?
|
||||
=rawtx =txid
|
||||
inputs=(list in:psbt)
|
||||
outputs=(list out:psbt)
|
||||
==
|
||||
^- base64:psbt
|
||||
=/ sep=(unit bytc) `1^0x0
|
||||
=/ final=(list (unit bytc))
|
||||
@ -272,7 +279,7 @@
|
||||
%+ turn
|
||||
%- zing
|
||||
:~ ~[(globals:en rawtx)]
|
||||
(turn inputs input:en)
|
||||
(turn inputs (cury input:en only-witness))
|
||||
(turn outputs output:en)
|
||||
==
|
||||
map-byts:en
|
||||
|
Loading…
Reference in New Issue
Block a user