Skip to content

Commit 40be31b

Browse files
author
Hack.bg R&D
committed
chore: bump parent dependency
1 parent 4718604 commit 40be31b

3 files changed

Lines changed: 17 additions & 10 deletions

File tree

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ RUN apt update && apt install -yy curl just git
1515
ARG ELEMENTS="https://github.com/ElementsProject/elements/releases/download/elements-23.3.1/elements-23.3.1-x86_64-linux-gnu.tar.gz"
1616
RUN cd /usr/local && curl -Lf "${ELEMENTS}" | tar --strip-components=1 -xz
1717
# This draws the rest of the owl.
18-
ARG FADROMA_REF="7753a0ea78"
18+
ARG FADROMA_REF="3a3d510b63"
1919
ARG FADROMA_URL="https://github.com/hackbg/fadroma"
2020
RUN git clone --progress -b v3-alpha "${FADROMA_URL}" /fadroma && cd /fadroma && git checkout "${FADROMA_REF}"
2121
WORKDIR /fadroma

src/sdk.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,11 +105,13 @@ export function Spend (): Spend {
105105
return spend;
106106
},
107107
async broadcast (chain: Btc) {
108+
const debug = (chain.debug ?? console.debug) || (() => {});
108109
if (!utxo) throw new Error('no input specified')
109110
if (!address || !amount) throw new Error('no output specified')
110111
if (!fee) throw new Error('no fee specified')
111112
const sender = chain.P2WPKH(signer.publicKey()).address;
112113
const options = { recipient: address, sender, utxos: [utxo], asset: utxo.asset, amount, fee };
114+
debug('Broadcasting:', options);
113115
const { sendSigned } = await Wasm();
114116
const { hex } = sendSigned(signer, options);
115117
const tx = await chain.broadcast(hex);

src/test.ts

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,6 @@ function TestSend (amount = 3000n, fee = 12000n) {
4343
}
4444
}
4545

46-
// Self-explanatory.
47-
export function TestOnTestnet () {
48-
// Tests that touch Liquid Testnet using Esplora
49-
return Test('liquidtestnet', () => LiquidTestnet(),
50-
TestSend(), // Test the basic transaction primitive
51-
'Programs' // TODO: Separate fixtures to reuse P2TR source/type defs
52-
);
53-
}
54-
5546
// Self-explanatory.
5647
export function TestOnLocalnet () {
5748
// Tests that run on temporary localnet:
@@ -108,6 +99,19 @@ export function TestOnLocalnet () {
10899
);
109100
}
110101

102+
// Self-explanatory.
103+
export function TestOnTestnet () {
104+
// Tests that touch Liquid Testnet using Esplora
105+
return Test('liquidtestnet', () => LiquidTestnet(),
106+
TestSend(), // Test the basic transaction primitive
107+
Test('Programs',
108+
TestProgram("unit program", 'fn main () {}', {
109+
p2tr: 'ert1p9jcvyzkdwdqtf49kta4xpc5g35xkfcexwfsl8v70w2gwttelncyspjlnrz',
110+
cmr: 'c40a10263f7436b4160acbef1c36fba4be4d95df181a968afeab5eac247adff7',
111+
fee: 2.7e-7 })),
112+
);
113+
}
114+
111115
/** Define example program. */
112116
function TestProgram (name: string, src: string, {
113117
/** Program runs that should fail. */
@@ -154,6 +158,7 @@ function TestProgram (name: string, src: string, {
154158
// Fund program from deployer:
155159
const commitSource = await chain.getUtxo(chain.P2WPKH(keypair1.publicKey()).address);
156160
const commitAmount = BigInt(Math.floor(commitSource.amount / 100) * 1e8) - BigInt(fee * 1e8);
161+
157162
const commitTxid = await SimplicityHL.Spend() // TODO wrap as program.commit() ?
158163
.asset(commitSource.asset)
159164
.input(commitSource, keypair1)

0 commit comments

Comments
 (0)