Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(mojaloop/#2880): simplify liquidity cover check and fix issue with validation (master) #86

Conversation

mdebarros
Copy link
Member

feat(mojaloop/#2880): simplify liquidity cover check and fix issue with validation (master) - mojaloop/project#2880

  • fixes to collections/hub/golden_path/feature_tests/block_transfers
    • aligned liquidity and position calculations with central-ledger logic
    • cleaned up unnecessary requests (i.e. why have two requests to fetch settlement and position accounts when it can be done in one?)
  • re-factored [new sims] transfers, positions CGS Window1 tests (OTC-649, OTC-645) @ collections/hub/golden_path/settlement_cgs/newsetcgs
    • standardised naming convention
    • re-aligned position, settlement and interchange checks with central-ledger logic, and expanded on checks dynamically based on the transfer amounts (Tx1, Tx2, Tx3, Tx4, Tx5, Tx6) instead of using "hard-coded" values
    • consolidated separate GET /account test-case for settlement, and positions into a single test-case (i.e. only need one call to admin API to retrieve balances and do validation checks)
    • added new OPTIONAL env vars for:
      1. SETTLEMENT_CGS_TX_AMOUNT_1 (defaults: 15), SETTLEMENT_CGS_TX_AMOUNT_2 (defaults: 87.88), SETTLEMENT_CGS_TX_AMOUNT_3 (defaults: 158.36), SETTLEMENT_CGS_TX_AMOUNT_4 (defaults: 211.11), SETTLEMENT_CGS_TX_AMOUNT_5 (defaults: 14.05), SETTLEMENT_CGS_TX_AMOUNT_6 (defaults: 150) representing the transfer amounts for each Transaction. These correlate to Tx1...Tx6
      2. SETTLEMENT_RULE_INTERCHANGE_FEE (defaults: 0.006) which is the Interchange Fee % used to calculate the aggregate Fee

…th validation

feat(mojaloop/#2880): simplify liquidity cover check and fix issue with validation - mojaloop/project#2880
- fixes to collections/hub/golden_path/feature_tests/block_transfers
  - aligned liquidity and position calculations with central-ledger logic
  - cleaned up unecessary requests (i.e. why have two requests to fetch settlement and position accounts when it can be done in one?)
- cleaned up test-scripts, and aligned them to central-ledger changes
- added new env var environment.SETTLEMENT_RULE_INTERCHANGE_FEE which defaults to '0.006' (ref: https://github.com/mojaloop/central-settlement/blob/master/scripts/transferSettlementTemp/interchangeFeeCalculation.js#L47)
- updated script logic to correctly calculate interchange-fees based on the provided environment.SETTLEMENT_RULE_INTERCHANGE_FEE
- re-factored `[new sims] transfers, positions CGS Window1 tests (OTC-649, OTC-645)`
  - standardised naming convention
  - re-aligned position, settlement and interchange checks, and expanded on checks dynamically based on the transfer amounts (Tx1, Tx2, Tx3, Tx4, Tx5, Tx6) instead of using "hard-coded" values
  - added new OPTIONAL env vars for:
    1. SETTLEMENT_CGS_TX_AMOUNT_1 (defaults: 15), SETTLEMENT_CGS_TX_AMOUNT_2 (defaults: 87.88), SETTLEMENT_CGS_TX_AMOUNT_3 (defaults: 158.36), SETTLEMENT_CGS_TX_AMOUNT_4 (defaults: 211.11), SETTLEMENT_CGS_TX_AMOUNT_5 (defaults: 14.05), SETTLEMENT_CGS_TX_AMOUNT_6 (defaults: 150) representing the transfer amounts for each Transaction. These correlate to Tx1...Tx6
    2. SETTLEMENT_RULE_INTERCHANGE_FEE (defaults: 0.006) which is the Interchange Fee % used to calculate the aggregate Fee
- removed duplicate test-cases
- fixed names for consistency
…es into feat/#2880-Simplify-liquidity-cover-check-and-fix-issue-with-validation
- added p2p happy path with balance checks (position, settlement, and reserved balances)
- fixed issue in block transfers to ensure that the amount removes trailing spaces by converting a number converted to a fixed string back into a number to drop any trailing zeros: Number(Number.toFixed(2))
- updated some descriptions/meta for newsetcgs test-cases
…test-cases into feat/#2880-Simplify-liquidity-cover-check-and-fix-issue-with-validation"

This reverts commit 62280d9, reversing
changes made to 6b876c4.
…case

- added funds-in for testfsp's 1,2,3 and 4
- added new optional environment parameters for each testfsp: SETTLEMENT_CGS_FUNDSIN_TESTFSP1, SETTLEMENT_CGS_FUNDSIN_TESTFSP2, SETTLEMENT_CGS_FUNDSIN_TESTFSP3, SETTLEMENT_CGS_FUNDSIN_TESTFSP4 - with defaults of 2000
- check to see settlement-balance has increased by the funds-in amount for testfsp 1, 2, 3 & 4
- disabled duplicate Get Balance requests for CGS tests, and added comment indicating that they are disabled by default but useful for debugging issues.
- removed duplicate tests (possible bug in TTK)
…toolkit-test-cases into feat/#2880-Simplify-liquidity-cover-check-and-fix-issue-with-validation""

This reverts commit eea9005.
@mdebarros mdebarros marked this pull request as ready for review September 6, 2022 17:47
- RETRY_MAX_ATTEMPTS from 10 to 20
- RETRY_MAX_WAIT_IN_MS from 200 to 250
fix(mojaloop/#2734): failures in daily cron job running GP tests - mojaloop/project#2734
- added re-try logic to close interchange-fee settlement window as part of CGS test-suite
elnyry-sam-k
elnyry-sam-k previously approved these changes Sep 7, 2022
…-with-validation' of github.com:mojaloop/testing-toolkit-test-cases into feat/#2880-Simplify-liquidity-cover-check-and-fix-issue-with-validation-master
@mdebarros mdebarros merged commit c547f2a into master Sep 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants