@@ -39,6 +39,7 @@ type ScoopTestOptions {
3939 edit_order_actual_destination: Option < Destination > ,
4040 edit_fee: Option < Value > ,
4141 edit_swap_fees: Option < ((Int ,Int ), (Int , Int ))> ,
42+ edit_new_swap_fees: Option < ((Int ,Int ), (Int , Int ))> ,
4243 edit_fee_admin: Option < Option < multisig.MultisigScript >> ,
4344 edit_withdrawals: Option < Dict < StakeCredential , Int >> ,
4445 edit_pool_input_address: Option < Address > ,
@@ -56,6 +57,7 @@ fn default_scoop_test_options() -> ScoopTestOptions {
5657 edit_order_actual_destination: None ,
5758 edit_fee: None ,
5859 edit_swap_fees: None ,
60+ edit_new_swap_fees: None ,
5961 edit_fee_admin: None ,
6062 edit_withdrawals: None ,
6163 edit_pool_input_address: None ,
@@ -719,10 +721,11 @@ fn update_pool_fees_transaction (options: ScoopTestOptions) {
719721 |> with_asset_of_tx_input (value.from_asset (constants.rberry_policy, constants.rberry_asset_name, 1_000_000_000 ))
720722 |> with_asset_of_tx_input (value.from_asset (constants.pool_script_hash, pool_nft_name, 1 ))
721723
724+ let new_pool_fees = option.or_else (options.edit_new_swap_fees, ((10 ,10 ),(310 ,150 )))
722725 let pool_out_datum = PoolDatum {
723726 .. 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 ,
726729 }
727730
728731 let pool_output = new_tx_output (pool_output_address, 0 , InlineDatum (pool_out_datum))
@@ -760,6 +763,14 @@ test update_pool_fees_transaction_test() {
760763 update_pool_fees_transaction (default_scoop_test_options ())
761764}
762765
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+
763774test cannot_update_pool_fees_transaction_test () fail {
764775 let settings = ScoopTestOptions {
765776 .. default_scoop_test_options (),
@@ -1191,4 +1202,4 @@ test burn_pool() {
11911202 let pool_mint_redeemer = BurnPool (constants.pool_ident)
11921203 let result = pool_validator.mint (constants.settings_policy_id, pool_mint_redeemer, ctx)
11931204 result
1194- }
1205+ }
0 commit comments