You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Refactor existing test and convert it into table tests covering the following scenarios:
WHEN TransferAuthorization contains 1 allocation AND source port ID/channel ID in MsgTransfer matches the source port and channel of the allocation AND the recipient address in MsgTransfer is found in the allow_list:
AND the amount in MsgTransfer is greater than the available funds, THEN error is returned.
AND the amount in MsgTransfer is equal to available funds, THEN the updated TransferAuthorization is nil.
AND the amount in MsgTransfer is smaller than the available funds, THEN the spend limit in the updated TransferAuthorization is reduced by the amount in MsgTransfer.
WHEN TransferAuthorization contains 1 allocation AND the source port ID/channel ID in combination MsgTransfer does not match the source port and channel of the allocation, THEN an error is returned.
WHEN TransferAuthorization contains 1 allocation AND source port ID/channel ID in MsgTransfer matches the source port and channel of the allocation AND the allow_list is empty AND the amount in MsgTransfer is smaller than the available funds, THEN the spend limit in the updated TransferAuthorization is reduced by the amount in MsgTransfer.
WHEN TransferAuthorization contains 1 allocation AND the recipient address is not in found in the allow_list, THEN an error is returned.
- WHEN TransferAuthorization contains 1 allocation with empty source port and source channel AND the recipient address in MsgTransfer is found in the allow_list AND the amount in MsgTransfer is smaller than the available funds, then the spend limit in the updated TransferAuthorization is reduced by the amount in MsgTransfer.
WHEN TransferAuthorization contains 2 allocations AND source port ID/channel ID in MsgTransfer matches the source port and channel of one of the allocations AND the recipient address in MsgTransfer is found in the allow_list:
AND the amount in MsgTransfer is greater than the available funds for one allocation, THEN an error is returned.
AND the amount in MsgTransfer is equal to available funds for one allocation, THEN the updated TransferAuthorization contains only the other allocation.
AND the amount in MsgTransfer is smaller than the available funds for one allocation, THEN the spend limit for that allocation in the updated TransferAuthorization is reduced by the amount in MsgTransfer and two allocations are returned.
crodriguezvega
changed the title
Integration tests for Accept method for authz ics20
authz/ics20: unit tests for Accept method of TransferAuthorizationDec 21, 2022
Refactor existing test and convert it into table tests covering the following scenarios:
WHEN
TransferAuthorization
contains 1 allocation AND source port ID/channel ID inMsgTransfer
matches the source port and channel of the allocation AND the recipient address inMsgTransfer
is found in theallow_list
:MsgTransfer
is greater than the available funds, THEN error is returned.MsgTransfer
is equal to available funds, THEN the updatedTransferAuthorization
isnil
.MsgTransfer
is smaller than the available funds, THEN the spend limit in the updatedTransferAuthorization
is reduced by the amount inMsgTransfer
.WHEN
TransferAuthorization
contains 1 allocation AND the source port ID/channel ID in combinationMsgTransfer
does not match the source port and channel of the allocation, THEN an error is returned.WHEN
TransferAuthorization
contains 1 allocation AND source port ID/channel ID inMsgTransfer
matches the source port and channel of the allocation AND theallow_list
is empty AND the amount inMsgTransfer
is smaller than the available funds, THEN the spend limit in the updatedTransferAuthorization
is reduced by the amount inMsgTransfer
.WHEN
TransferAuthorization
contains 1 allocation AND the recipient address is not in found in theallow_list
, THEN an error is returned.- WHENTransferAuthorization
contains 1 allocation with empty source port and source channel AND the recipient address inMsgTransfer
is found in theallow_list
AND the amount inMsgTransfer
is smaller than the available funds, then the spend limit in the updatedTransferAuthorization
is reduced by the amount inMsgTransfer
.TransferAuthorization
contains 2 allocations AND source port ID/channel ID inMsgTransfer
matches the source port and channel of one of the allocations AND the recipient address inMsgTransfer
is found in theallow_list
:MsgTransfer
is greater than the available funds for one allocation, THEN an error is returned.MsgTransfer
is equal to available funds for one allocation, THEN the updatedTransferAuthorization
contains only the other allocation.MsgTransfer
is smaller than the available funds for one allocation, THEN the spend limit for that allocation in the updatedTransferAuthorization
is reduced by the amount inMsgTransfer
and two allocations are returned.Open PRs against the feature branch.
The text was updated successfully, but these errors were encountered: