@@ -39,6 +39,7 @@ type ScoopTestOptions {
39
39
edit_order_actual_destination: Option < Destination > ,
40
40
edit_fee: Option < Value > ,
41
41
edit_swap_fees: Option < ((Int ,Int ), (Int , Int ))> ,
42
+ edit_new_swap_fees: Option < ((Int ,Int ), (Int , Int ))> ,
42
43
edit_fee_admin: Option < Option < multisig.MultisigScript >> ,
43
44
edit_withdrawals: Option < Dict < StakeCredential , Int >> ,
44
45
edit_pool_input_address: Option < Address > ,
@@ -56,6 +57,7 @@ fn default_scoop_test_options() -> ScoopTestOptions {
56
57
edit_order_actual_destination: None ,
57
58
edit_fee: None ,
58
59
edit_swap_fees: None ,
60
+ edit_new_swap_fees: None ,
59
61
edit_fee_admin: None ,
60
62
edit_withdrawals: None ,
61
63
edit_pool_input_address: None ,
@@ -719,10 +721,11 @@ fn update_pool_fees_transaction (options: ScoopTestOptions) {
719
721
|> with_asset_of_tx_input (value.from_asset (constants.rberry_policy, constants.rberry_asset_name, 1_000_000_000 ))
720
722
|> with_asset_of_tx_input (value.from_asset (constants.pool_script_hash, pool_nft_name, 1 ))
721
723
724
+ let new_pool_fees = option.or_else (options.edit_new_swap_fees, ((10 ,10 ),(310 ,150 )))
722
725
let pool_out_datum = PoolDatum {
723
726
.. pool_datum,
724
- bid_fees_per_10_thousand: ( 10 , 10 ) ,
725
- ask_fees_per_10_thousand: ( 310 , 150 ) ,
727
+ bid_fees_per_10_thousand: new_pool_fees.1st ,
728
+ ask_fees_per_10_thousand: new_pool_fees.2nd ,
726
729
}
727
730
728
731
let pool_output = new_tx_output (pool_output_address, 0 , InlineDatum (pool_out_datum))
@@ -760,6 +763,14 @@ test update_pool_fees_transaction_test() {
760
763
update_pool_fees_transaction (default_scoop_test_options ())
761
764
}
762
765
766
+ test illegal_new_pool_fees_test () fail {
767
+ let settings = ScoopTestOptions {
768
+ .. default_scoop_test_options (),
769
+ edit_new_swap_fees: Some (((10001 ,10001 ),(10001 ,10001 ))),
770
+ }
771
+ update_pool_fees_transaction (settings)
772
+ }
773
+
763
774
test cannot_update_pool_fees_transaction_test () fail {
764
775
let settings = ScoopTestOptions {
765
776
.. default_scoop_test_options (),
@@ -1191,4 +1202,4 @@ test burn_pool() {
1191
1202
let pool_mint_redeemer = BurnPool (constants.pool_ident)
1192
1203
let result = pool_validator.mint (constants.settings_policy_id, pool_mint_redeemer, ctx)
1193
1204
result
1194
- }
1205
+ }
0 commit comments