Skip to content

Commit

Permalink
chore: rename checkTransfer to checkSettle
Browse files Browse the repository at this point in the history
The following breaking changes are from earlier commits

BREAKING CHANGE:
- Transfers namespace changes to Settlements
- `canTransfer` renamed to `canSettle`
- `areFrozen` renamed to `isFrozen`
- `transfers.freeze()`, `transfers.unfreeze()` and `transfers.isFrozen()` moved to `securityToken.freeze()`, `securityToken.unfreeze()` and `securityToken.isFrozen()`
- `checkTransfer()` renamed to `checkSettle()`
  • Loading branch information
shuffledex committed Sep 29, 2020
1 parent ad26622 commit ecf8ef9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/api/entities/SecurityToken/Compliance/Requirements.ts
Expand Up @@ -144,7 +144,7 @@ export class Requirements extends Namespace<SecurityToken> {
* @param args.from - sender Identity (optional, defaults to the current Identity)
* @param args.to - receiver Identity
*/
public async checkTransfer(args: {
public async checkSettle(args: {
from?: string | Identity;
to: string | Identity;
}): Promise<RequirementCompliance> {
Expand Down
Expand Up @@ -339,7 +339,7 @@ describe('Requirements class', () => {
});
});

describe('method: checkTransfer', () => {
describe('method: checkSettle', () => {
let context: Mocked<Context>;
let token: SecurityToken;
let requirements: Requirements;
Expand Down Expand Up @@ -388,7 +388,7 @@ describe('Requirements class', () => {
sinon.restore();
});

test('checkTransfer should return the current requirement compliance and whether the transfer complies', async () => {
test('checkSettle should return the current requirement compliance and whether the transfer complies', async () => {
const rawResponse = ('response' as unknown) as AssetComplianceResult;

dsMockUtils
Expand All @@ -400,12 +400,12 @@ describe('Requirements class', () => {

assetComplianceResultToRequirementComplianceStub.withArgs(rawResponse).returns(fakeResult);

const result = await requirements.checkTransfer({ to: toDid });
const result = await requirements.checkSettle({ to: toDid });

expect(result).toEqual(fakeResult);
});

test('checkTransfer should return the current requirement compliance and whether the transfer complies with another Identity', async () => {
test('checkSettle should return the current requirement compliance and whether the transfer complies with another Identity', async () => {
const rawResponse = ('response' as unknown) as AssetComplianceResult;

dsMockUtils
Expand All @@ -417,7 +417,7 @@ describe('Requirements class', () => {

assetComplianceResultToRequirementComplianceStub.withArgs(rawResponse).returns(fakeResult);

const result = await requirements.checkTransfer({ from: fromDid, to: toDid });
const result = await requirements.checkSettle({ from: fromDid, to: toDid });

expect(result).toBe(fakeResult);
});
Expand Down

0 comments on commit ecf8ef9

Please sign in to comment.