@@ -44,7 +44,7 @@ fn works_for_execution_fees() {
4444 . deposit_asset ( All , RECIPIENT . clone ( ) )
4545 . build ( ) ;
4646
47- let mut vm = instantiate_executor ( SENDER , xcm. clone ( ) ) ;
47+ let ( mut vm, weight ) = instantiate_executor ( SENDER , xcm. clone ( ) ) ;
4848
4949 // Program runs successfully.
5050 assert ! ( vm. bench_process( xcm) . is_ok( ) ) ;
@@ -57,6 +57,10 @@ fn works_for_execution_fees() {
5757 // The recipient received all the assets in the holding register, so `100` that
5858 // were withdrawn, minus the `10` that were destinated for fee payment.
5959 assert_eq ! ( asset_list( RECIPIENT ) , [ ( Here , 90u128 ) . into( ) ] ) ;
60+
61+ // Leftover fees get trapped.
62+ assert ! ( vm. bench_post_process( weight) . ensure_complete( ) . is_ok( ) ) ;
63+ assert_eq ! ( asset_list( TRAPPED_ASSETS ) , [ ( Here , 6u128 ) . into( ) ] )
6064}
6165
6266// This tests the new functionality provided by `PayFees`, being able to pay for
@@ -82,7 +86,7 @@ fn works_for_delivery_fees() {
8286 . deposit_asset ( All , RECIPIENT . clone ( ) )
8387 . build ( ) ;
8488
85- let mut vm = instantiate_executor ( SENDER . clone ( ) , xcm. clone ( ) ) ;
89+ let ( mut vm, _ ) = instantiate_executor ( SENDER . clone ( ) , xcm. clone ( ) ) ;
8690
8791 // Program runs successfully.
8892 assert ! ( vm. bench_process( xcm) . is_ok( ) ) ;
@@ -135,7 +139,7 @@ fn buy_execution_works_as_before() {
135139 . deposit_asset ( All , RECIPIENT . clone ( ) )
136140 . build ( ) ;
137141
138- let mut vm = instantiate_executor ( SENDER , xcm. clone ( ) ) ;
142+ let ( mut vm, _ ) = instantiate_executor ( SENDER , xcm. clone ( ) ) ;
139143
140144 // Program runs successfully.
141145 assert ! ( vm. bench_process( xcm) . is_ok( ) ) ;
@@ -165,7 +169,7 @@ fn fees_can_be_refunded() {
165169 . deposit_asset ( All , SENDER . clone ( ) )
166170 . build ( ) ;
167171
168- let mut vm = instantiate_executor ( SENDER . clone ( ) , xcm. clone ( ) ) ;
172+ let ( mut vm, _ ) = instantiate_executor ( SENDER . clone ( ) , xcm. clone ( ) ) ;
169173
170174 // Program runs successfully.
171175 assert ! ( vm. bench_process( xcm) . is_ok( ) ) ;
@@ -197,7 +201,7 @@ fn putting_all_assets_in_pay_fees() {
197201 . deposit_asset ( All , RECIPIENT . clone ( ) )
198202 . build ( ) ;
199203
200- let mut vm = instantiate_executor ( SENDER . clone ( ) , xcm. clone ( ) ) ;
204+ let ( mut vm, _ ) = instantiate_executor ( SENDER . clone ( ) , xcm. clone ( ) ) ;
201205
202206 // Program runs successfully.
203207 assert ! ( vm. bench_process( xcm) . is_ok( ) ) ;
@@ -234,7 +238,7 @@ fn refunding_too_early() {
234238 . report_error ( query_response_info)
235239 . build ( ) ;
236240
237- let mut vm = instantiate_executor ( SENDER . clone ( ) , xcm. clone ( ) ) ;
241+ let ( mut vm, _ ) = instantiate_executor ( SENDER . clone ( ) , xcm. clone ( ) ) ;
238242
239243 // Program fails to run.
240244 assert ! ( vm. bench_process( xcm) . is_err( ) ) ;
0 commit comments