Skip to content

Commit

Permalink
feat: update liquidity check (#899)
Browse files Browse the repository at this point in the history
- feat:
  - Added additional liquidity check [design-authority-project/issues/90](mojaloop/design-authority-project#90)

- chore:
  - refactored fundsIn in admin handler
  - updated dependencies
  - fixed audit-resolve issues
  - fixed unit tests

- fix:
  - changed the default config for running integration tests
  - fixed an issue with an integration test
correctly into a object
  - Added unit tests for config changes

BREAKING CHANGE: Transfer will be successful only if the payer has settlement account balance. This is the additional check that has been added in this PR. And also the error message is changed for NDC limit check from `PAYER_FSP_INSUFFICIENT_LIQUIDITY` to `PAYER_LIMIT_ERROR`. Now the error message `PAYER_FSP_INSUFFICIENT_LIQUIDITY` occurs when the payer has insufficient settlement account balance.
  • Loading branch information
vijayg10 authored May 17, 2022
1 parent d30c0b1 commit 2e33a5a
Show file tree
Hide file tree
Showing 31 changed files with 1,320 additions and 800 deletions.
21 changes: 14 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,19 +72,26 @@ Running the tests:

Tests include code coverage via istanbul. See the test/ folder for testing scripts.

### Running Integration Tests interactively-ish
### Running Integration Tests interactively

If you want to run integration tests in a repetitive manner, you can startup the test containers using `docker-compose`, login to running `central-ledger` container like so:

```bash
docker-compose -f docker-compose.yml -f docker-compose.integration.yml up -d kafka mysql central-ledger

#in a new shell
docker exec -it cl_central-ledger sh
export CL_DATABASE_HOST=mysql
npm run migrate #first time only
npm run test:int
```
- Running inside docker
```bash
docker exec -it cl_central-ledger sh
export CL_DATABASE_HOST=mysql
npm run migrate #first time only
npm run test:int
```
- Running natively
```bash
export CL_DATABASE_HOST=localhost
npm run migrate #first time only
npm run test:int
```

## Auditing Dependencies

Expand Down
52 changes: 52 additions & 0 deletions audit-resolve.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,58 @@
"decision": "ignore",
"madeAt": 1648636274889,
"expiresAt": 1651228244345
},
"1069987|@mojaloop/central-services-shared>widdershins>urijs": {
"decision": "fix",
"madeAt": 1652705152224
},
"1069988|@mojaloop/central-services-shared>widdershins>urijs": {
"decision": "fix",
"madeAt": 1652705152224
},
"1067553|@mojaloop/central-services-shared>widdershins>swagger2openapi>better-ajv-errors>jsonpointer": {
"decision": "postpone",
"madeAt": 1652795995442
},
"1067553|@mojaloop/central-services-shared>widdershins>swagger2openapi>oas-validator>better-ajv-errors>jsonpointer": {
"decision": "postpone",
"madeAt": 1652795995442
},
"1067560|hapi-swagger>swagger-parser>z-schema>validator": {
"decision": "postpone",
"madeAt": 1652795996027
},
"1067946|@mojaloop/central-services-shared>widdershins>swagger2openapi>oas-validator>ajv": {
"decision": "postpone",
"madeAt": 1652795996489
},
"1068155|@mojaloop/central-services-shared>shins>sanitize-html": {
"decision": "postpone",
"madeAt": 1652795997039
},
"1070260|@mojaloop/central-services-shared>shins>sanitize-html": {
"decision": "postpone",
"madeAt": 1652795997039
},
"1068310|@mojaloop/central-services-shared>widdershins>yargs>yargs-parser": {
"decision": "postpone",
"madeAt": 1652795997537
},
"1070030|@mojaloop/central-services-shared>shins>markdown-it": {
"decision": "postpone",
"madeAt": 1652795998107
},
"1070207|@mojaloop/central-services-stream>async": {
"decision": "postpone",
"madeAt": 1652795998636
},
"1070245|@mojaloop/event-sdk>moment": {
"decision": "postpone",
"madeAt": 1652795999156
},
"1070256|@mojaloop/central-services-shared>shins>ejs": {
"decision": "postpone",
"madeAt": 1652795999627
}
},
"rules": {},
Expand Down
26 changes: 26 additions & 0 deletions config/default.json
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,32 @@
}
}
}
},
"NOTIFICATION": {
"EVENT": {
"config": {
"options": {
"mode": 2,
"batchSize": 1,
"pollFrequency": 10,
"recursiveTimeout": 100,
"messageCharset": "utf8",
"messageAsJSON": true,
"sync": true,
"consumeTimeout": 1000
},
"rdkafkaConf": {
"client.id": "TESTONLY",
"group.id": "TESTONLY",
"metadata.broker.list": "localhost:9092",
"socket.keepalive.enable": true,
"allow.auto.create.topics": true
},
"topicConf": {
"auto.offset.reset": "earliest"
}
}
}
}
},
"PRODUCER": {
Expand Down
Loading

0 comments on commit 2e33a5a

Please sign in to comment.