Skip to content

Commit

Permalink
Fix regression tests
Browse files Browse the repository at this point in the history
  • Loading branch information
vkresch committed Jun 30, 2024
1 parent 0a666c3 commit b92f487
Show file tree
Hide file tree
Showing 58 changed files with 881 additions and 20,841 deletions.
1 change: 0 additions & 1 deletion .env.example

This file was deleted.

3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ jobs:
python -m pip install -r requirements.txt
python -m pip install -r requirements_developers.txt
- name: Test with pytest
run: pytest tests/

build-documentation:
runs-on: ubuntu-latest
strategy:
Expand Down
6 changes: 0 additions & 6 deletions docs/configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -171,12 +171,6 @@ Available configuration parameters are:
tz1RMmSzPSWPSSaKU193Voh4PosWSZx1C7Hs: Dexter #(indicates address is a dexter pool; TRD will send rewards to pool members)
mindelegation: TOE #(mindelegation will be shared with everyone)

**tzpro_api_key**
Generate a tzpro API key [here](https://tzpro.io/) if you want to use it as reward or block API.

Example::
tzpro_api_key: XXXXXXXXXX

**plugins**
Please consult the `plugins docs`_ for more details on the configuring the various plugins.

Expand Down
1 change: 0 additions & 1 deletion examples/tz1boot1pK9h2BVGXdyvfQSv8kd1LQM6H889.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ baking_address: tz1boot1pK9h2BVGXdyvfQSv8kd1LQM6H889
payment_address: KT1KLQbYFtFZ5mAEnfEMZaWYuNtCsGuP5cLS
rewards_type: actual
service_fee: 4.5
tzpro_api_key: XXXXXXXX
founders_map:
{'tz1boot1pK9h2BVGXdyvfQSv8kd1LQM6H889' : 0.3,
'KT1KLQbYFtFZ5mAEnfEMZaWYuNtCsGuP5cLS' : 0.7}
Expand Down
6 changes: 0 additions & 6 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,6 @@ TRD supports complex payments, pays in batches, and supports three backends for

**Provider notes:**

### Blockwatch: TZPRO

The [terms and conditions](https://tzpro.io/terms) of TZPRO note that an account and API key are needed for the use of the API. Please review the [pricing](https://tzpro.io/#pricing) information. For further help contact [email protected] for more information.

In order to use your API key in the application add it to your configuration like tzpro_api_key: XXXXXXXXXX.

### TzKT

The [terms of use](https://api.tzkt.io/#section/Terms-of-Use) of TzKT API allow for commercial and non-commercial use.
Expand Down
2 changes: 0 additions & 2 deletions src/api/provider_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ def newRewardApi(
node_url,
node_url_public="",
api_base_url=None,
tzpro_api_key="",
):
return TzKTRewardApiImpl(network_config, baking_address, base_url=api_base_url)

Expand All @@ -22,6 +21,5 @@ def newBlockApi(
network_config,
node_url,
api_base_url=None,
tzpro_api_key="",
):
return TzKTBlockApiImpl(network_config, base_url=api_base_url)
14 changes: 0 additions & 14 deletions src/config/yaml_baking_conf_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,20 +56,6 @@ def __init__(
super().__init__(yaml_text)
self.clnt_mngr = clnt_mngr
self.network_config = network_config
if block_api is None:
# NOTE: We need to parse the config early to get the api key for tzpro if no block api was defined
# TODO: We might wanna disable the option to pass a None block_api parameter
tzpro_api_key = (
""
if provider_factory.provider != "tzpro"
else yaml.safe_load(yaml_text).get("tzpro_api_key", "")
)
block_api = provider_factory.newBlockApi(
network_config,
node_url,
api_base_url=api_base_url,
tzpro_api_key=tzpro_api_key,
)
self.block_api = block_api
self.dry_run = dry_run
self.address_validator = AddressValidator()
Expand Down
4 changes: 0 additions & 4 deletions src/model/baking_conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
REWARDS_TYPE = "rewards_type"
PAY_DENUNCIATION_REWARDS = "pay_denunciation_rewards"
MIN_PAYMENT_AMT = "min_payment_amt"
TZPRO_API_KEY = "tzpro_api_key"

# extensions
FULL_SUPPORTERS_SET = "__full_supporters_set"
Expand Down Expand Up @@ -122,6 +121,3 @@ def __repr__(self) -> str:

def get_min_payment_amount(self):
return self.get_attribute(MIN_PAYMENT_AMT)

def get_tzpro_api_key(self):
return self.get_attribute(TZPRO_API_KEY, default=None)
39 changes: 18 additions & 21 deletions src/pay/payment_producer.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,24 @@ def __init__(
retry_injected=False,
):
super(PaymentProducer, self).__init__()
self.exiting = False
self.nw_config = network_config
self.payments_root = payments_dir
self.calculations_dir = calculations_dir
self.run_mode = run_mode

self.payment_offset = payment_offset
self.payments_queue = payments_queue
self.life_cycle = life_cycle
self.dry_run = dry_run
self.consumer_failure = False

self.retry_fail_thread = threading.Thread(
target=self.retry_fail_run, name=self.name + "_retry_fail"
)
self.retry_fail_event = threading.Event()
self.retry_injected = retry_injected

self.event = threading.Event()
self.rules_model = RulesModel(
baking_cfg.get_excluded_set_tob(),
Expand All @@ -72,20 +90,17 @@ def __init__(

self.node_url = node_url
self.client_manager = client_manager
self.tzpro_api_key = baking_cfg.get_tzpro_api_key()
self.reward_api = self.provider_factory.newRewardApi(
network_config,
self.baking_address,
self.node_url,
node_url_public,
api_base_url,
self.tzpro_api_key,
)
self.block_api = self.provider_factory.newBlockApi(
network_config,
self.node_url,
api_base_url,
self.tzpro_api_key,
)

dexter_contracts_set = baking_cfg.get_contracts_set()
Expand All @@ -109,18 +124,6 @@ def __init__(

logger.info("Initial cycle set to {}".format(self.initial_payment_cycle))

self.nw_config = network_config
self.payments_root = payments_dir
self.calculations_dir = calculations_dir
self.run_mode = run_mode
self.exiting = False

self.payment_offset = payment_offset
self.payments_queue = payments_queue
self.life_cycle = life_cycle
self.dry_run = dry_run
self.consumer_failure = False

self.payment_calc = PhasedPaymentCalculator(
self.founders_map,
self.owners_map,
Expand All @@ -131,12 +134,6 @@ def __init__(
self.reward_api,
)

self.retry_fail_thread = threading.Thread(
target=self.retry_fail_run, name=self.name + "_retry_fail"
)
self.retry_fail_event = threading.Event()
self.retry_injected = retry_injected

self.retry_producer = RetryProducer(
self.payments_queue,
self.reward_api,
Expand Down

Large diffs are not rendered by default.

280 changes: 9 additions & 271 deletions tests/integration/cassettes/api_consistency/test_get_delegatable.yaml

Large diffs are not rendered by default.

Loading

0 comments on commit b92f487

Please sign in to comment.