|
1 | 1 | #!/usr/bin/env -S deno run --allow-read --allow-env --allow-run --allow-write=/tmp/fadroma --allow-import=cdn.skypack.dev:443,deno.land:443 --allow-net=127.0.0.1:8941,liquidtestnet.com:443,blockstream.info:443 |
2 | 2 | import { deepStrictEqual as equal, rejects, throws, ok } from 'node:assert'; |
3 | 3 | import { Base16, Fn, Test, Run, sleep } from '../../../library/index.ts'; |
4 | | -import Btc, { BtcRpc, LiquidTestnet, ElementsRegtest } from '../../Bitcoin/index.ts'; |
5 | | -import { SendFromWallet, AssertBalance } from '../../Bitcoin/test.ts'; |
| 4 | +import Btc, { Rpc, LiquidTestnet, ElementsRegtest } from '../../Bitcoin/index.ts'; |
6 | 5 | import { Signer, Program, Wasm, Arg, Args } from './sdk.ts'; |
7 | 6 | const { is, has } = Test; |
8 | | -const { CreateWallet, Rescan } = BtcRpc; |
9 | | -const { INITIAL_COINS, BITCOIN } = ElementsRegtest; |
10 | 7 | const { sendSigned, keypair } = await Wasm(); |
11 | 8 |
|
12 | 9 | const SIGNER = await Signer(new Uint8Array(Array(32).fill(1))); |
@@ -41,17 +38,9 @@ export function TestOnTestnet () { |
41 | 38 | } |
42 | 39 |
|
43 | 40 | export function TestOnLocalnet () { |
44 | | - /** When starting the localnet, the genesis balance is not indexed. */ |
45 | | - const BALANCE_EMPTY = { bitcoin: 0 }; |
46 | | - /** After RPC rescanblockchain, it shoud look like this. */ |
47 | | - const BALANCE_INITIAL = { [ElementsRegtest.ASSETS.REISSUE]: 1, bitcoin: Number(INITIAL_COINS / BITCOIN) }; |
48 | 41 | // Tests that run on temporary localnet: |
49 | | - return Test('elementsregtest', |
50 | | - () => ElementsRegtest({ debugs: false, debugexclude: ['libevent'] }), |
51 | | - Run.Verbose(true), // Pipe the localnet's output to stderr |
52 | | - CreateWallet('test-simf', AssertBalance(BALANCE_EMPTY)), |
53 | | - Rescan(AssertBalance(BALANCE_INITIAL)), |
54 | | - SendFromWallet("100000", 8), // Fund deployer (non-secret key 8) from genesis wallet |
| 42 | + return ElementsRegtest.Test({}, |
| 43 | + Rpc.SendFromWallet("100000", 8), // Fund deployer (non-secret key 8) from genesis wallet |
55 | 44 | TestSend(), // Test the basic transaction primitive |
56 | 45 | Test('Programs', // Test SimplicityHL commitment and redemption transactions. |
57 | 46 | // Empty program, always passes: |
|
0 commit comments