@@ -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.
5647export 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. */
112116function 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