Skip to content

Commit

Permalink
feat(mojaloop/csi-190): add new state and functionality to handle pro…
Browse files Browse the repository at this point in the history
…xied transfers (#1059)

* diff

* update diagram

* chore: happy path

* chore: int tests

* chore(snapshot): 17.8.0-snapshot.0

* update tests

* chore: add error cases

* test: coverage

* tests

* tests

* fix test

* update dep

---------

Co-authored-by: Kalin Krustev <[email protected]>
  • Loading branch information
kleyow and kalinkrustev authored Jul 15, 2024
1 parent 0562282 commit fef1a57
Show file tree
Hide file tree
Showing 17 changed files with 864 additions and 43 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ Or via docker build directly:

```bash
docker build \
--build-arg NODE_VERSION="$(cat .nvmrc)-alpine" \
--build-arg NODE_VERSION="$(cat .nvmrc)-alpine3.19" \
-t mojaloop/ml-api-adapter:local \
.
```
Expand Down Expand Up @@ -403,4 +403,4 @@ push a release triggering another subsequent build that also publishes a docker
is a boon.

- It is unknown if a race condition might occur with multiple merges with main in
quick succession, but this is a suspected edge case.
quick succession, but this is a suspected edge case.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 10 additions & 3 deletions documentation/state-diagrams/transfer-internal-states.plantuml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ state RECEIVED {
state RESERVED_ {
state RESERVED {
}
state RESERVED_FORWARDED {
}
state RECEIVED_FULFIL {
}
state RECEIVED_FULFIL_DEPENDENT {
Expand Down Expand Up @@ -48,20 +50,25 @@ RECEIVED_PREPARE --> RECEIVED_REJECT : Reject callback from Payee with status "A
RECEIVED_PREPARE --> RECEIVED_ERROR : Transfer Error callback from Payee

RECEIVED_FULFIL --> COMMITTED : Transfer committed [Position handler] \n <i>(commit funds, assign T. to settlement window)</i>

RECEIVED_REJECT --> ABORTED_REJECTED : Transfer Aborted by Payee
RECEIVED_ERROR --> ABORTED_ERROR : Hub aborts T.
RECEIVED_PREPARE --> EXPIRED_PREPARED : Timeout handler \n detects T. being EXPIRED

RESERVED --> RECEIVED_FULFIL : Fulfil callback from Payee \n with status "COMMITTED" \n [Fulfil handler]: \n <i>fulfilment check passed</i>
RESERVED --> RECEIVED_ERROR : Fulfil callback from Payee fails validation\n [Fulfil handler]
RESERVED --> RECEIVED_FULFIL_DEPENDENT : Recieved FX transfer fulfilment
RESERVED --> RESERVED_FORWARDED : A Proxy participant has acknowledged the transfer to be forwarded
RESERVED --> RESERVED_TIMEOUT : Timeout handler
RESERVED_TIMEOUT --> EXPIRED_RESERVED : Hub aborts T. due to being EXPIRED

RESERVED --> RECEIVED_FULFIL_DEPENDENT : Recieved FX transfer fulfilment
RESERVED_FORWARDED --> RECEIVED_FULFIL : Fulfil callback from Payee \n with status "COMMITTED" \n [Fulfil handler]: \n <i>fulfilment check passed</i>
RESERVED_FORWARDED --> RECEIVED_ERROR : Fulfil callback from Payee fails validation\n [Fulfil handler]
RESERVED_FORWARDED --> RECEIVED_FULFIL_DEPENDENT : Recieved FX transfer fulfilment

RECEIVED_FULFIL_DEPENDENT --> COMMITTED : Dependant transfer committed [Position handler] \n <i>(commit funds, assign T. to settlement window)</i>
RECEIVED_FULFIL_DEPENDENT --> RESERVED_TIMEOUT : Dependant transfer is timed out

RESERVED_TIMEOUT --> EXPIRED_RESERVED : Hub aborts T. due to being EXPIRED

COMMITTED --> [*]
ABORTED --> [*]

Expand Down
Loading

0 comments on commit fef1a57

Please sign in to comment.