@@ -141,14 +141,14 @@ fn insert_txouts() {
141141 changeset,
142142 ChangeSet {
143143 txs: [ update_txs. clone( ) ] . into( ) ,
144- txouts: update_ops. into( ) ,
144+ txouts: update_ops. clone ( ) . into( ) ,
145145 anchors: [ ( conf_anchor, update_txs. txid( ) ) , ( unconf_anchor, h!( "tx2" ) ) ] . into( ) ,
146146 last_seen: [ ( h!( "tx2" ) , 1000000 ) ] . into( )
147147 }
148148 ) ;
149149
150150 // Apply changeset and check the new graph counts.
151- graph. apply_changeset ( changeset) ;
151+ graph. apply_changeset ( changeset. clone ( ) ) ;
152152 assert_eq ! ( graph. all_txouts( ) . count( ) , 4 ) ;
153153 assert_eq ! ( graph. full_txs( ) . count( ) , 1 ) ;
154154 assert_eq ! ( graph. floating_txouts( ) . count( ) , 3 ) ;
@@ -186,6 +186,17 @@ fn insert_txouts() {
186186 ) ]
187187 . into( )
188188 ) ;
189+
190+ // Check that the initial_changeset is correct
191+ assert_eq ! (
192+ graph. initial_changeset( ) ,
193+ ChangeSet {
194+ txs: [ update_txs. clone( ) ] . into( ) ,
195+ txouts: update_ops. into_iter( ) . chain( original_ops) . collect( ) ,
196+ anchors: [ ( conf_anchor, update_txs. txid( ) ) , ( unconf_anchor, h!( "tx2" ) ) ] . into( ) ,
197+ last_seen: [ ( h!( "tx2" ) , 1000000 ) ] . into( )
198+ }
199+ ) ;
189200}
190201
191202#[ test]
0 commit comments