Skip to content

Commit

Permalink
test: change back param name from allowNonLSP1Recipient to force
Browse files Browse the repository at this point in the history
  • Loading branch information
CJ42 committed Sep 19, 2023
1 parent d59a2ff commit 7b97ed9
Show file tree
Hide file tree
Showing 7 changed files with 188 additions and 249 deletions.
2 changes: 1 addition & 1 deletion tests/LSP6KeyManager/Interactions/BatchExecute.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ export const shouldBehaveLikeBatchExecute = (
[sender, sender, sender], // address[] memory from,
recipients, // address[] memory to,
amounts, // uint256[] memory amount,
[true, true, true], // bool[] memory allowNonLSP1Recipient,
[true, true, true], // bool[] memory force,
['0x', '0x', '0x'], // bytes[] memory data
]);

Expand Down
84 changes: 42 additions & 42 deletions tests/LSP7DigitalAsset/LSP7CompatibleERC20.behaviour.ts
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ export const shouldBehaveLikeLSP7CompatibleERC20 = (
from: string;
to: string;
amount: BigNumber;
allowNonLSP1Recipient?: boolean;
force?: boolean;
data?: string;
};

Expand Down Expand Up @@ -450,7 +450,7 @@ export const shouldBehaveLikeLSP7CompatibleERC20 = (
txParams.from,
txParams.to,
txParams.amount,
txParams.allowNonLSP1Recipient ?? true,
txParams.force ?? true,
expectedData,
);

Expand Down Expand Up @@ -810,13 +810,13 @@ export const shouldBehaveLikeLSP7CompatibleERC20 = (

describe('when caller (msg.sender) is the `from` address', () => {
describe('when `to` is an EOA', () => {
it('should allow transfering the tokens with `allowNonLSP1Recipient` param = true', async () => {
it('should allow transfering the tokens with `force` param = true', async () => {
const txParams = {
operator: context.accounts.owner,
from: context.accounts.owner.address,
to: context.accounts.tokenReceiver.address,
amount: transferAmount,
allowNonLSP1Recipient: true,
force: true,
data: expectedData,
};

Expand All @@ -829,20 +829,20 @@ export const shouldBehaveLikeLSP7CompatibleERC20 = (
txParams.from,
txParams.to,
txParams.amount,
txParams.allowNonLSP1Recipient,
txParams.force,
txParams.data,
),
expectedData,
);
});

it('should NOT allow transfering the tokens with `allowNonLSP1Recipient` param = false', async () => {
it('should NOT allow transfering the tokens with `force` param = false', async () => {
const txParams = {
operator: context.accounts.owner,
from: context.accounts.owner.address,
to: context.accounts.tokenReceiver.address,
amount: transferAmount,
allowNonLSP1Recipient: false,
force: false,
data: expectedData,
};

Expand All @@ -856,7 +856,7 @@ export const shouldBehaveLikeLSP7CompatibleERC20 = (
txParams.from,
txParams.to,
txParams.amount,
txParams.allowNonLSP1Recipient,
txParams.force,
txParams.data,
),
)
Expand All @@ -874,13 +874,13 @@ export const shouldBehaveLikeLSP7CompatibleERC20 = (

describe('when `to` is a contract', () => {
describe('when receiving contract supports LSP1', () => {
it('should allow transfering the tokens with `allowNonLSP1Recipient` param = true', async () => {
it('should allow transfering the tokens with `force` param = true', async () => {
const txParams = {
operator: context.accounts.owner,
from: context.accounts.owner.address,
to: deployedContracts.tokenReceiverWithLSP1.address,
amount: transferAmount,
allowNonLSP1Recipient: true,
force: true,
data: expectedData,
};

Expand All @@ -893,20 +893,20 @@ export const shouldBehaveLikeLSP7CompatibleERC20 = (
txParams.from,
txParams.to,
txParams.amount,
txParams.allowNonLSP1Recipient,
txParams.force,
txParams.data,
),
expectedData,
);
});

it('should allow transfering the tokens with `allowNonLSP1Recipient` param = false', async () => {
it('should allow transfering the tokens with `force` param = false', async () => {
const txParams = {
operator: context.accounts.owner,
from: context.accounts.owner.address,
to: deployedContracts.tokenReceiverWithLSP1.address,
amount: transferAmount,
allowNonLSP1Recipient: false,
force: false,
data: expectedData,
};

Expand All @@ -919,7 +919,7 @@ export const shouldBehaveLikeLSP7CompatibleERC20 = (
txParams.from,
txParams.to,
txParams.amount,
txParams.allowNonLSP1Recipient,
txParams.force,
txParams.data,
),
expectedData,
Expand All @@ -928,13 +928,13 @@ export const shouldBehaveLikeLSP7CompatibleERC20 = (
});

describe('when receiving contract does not support LSP1', () => {
it('should allow transfering the tokens with `allowNonLSP1Recipient` param = true', async () => {
it('should allow transfering the tokens with `force` param = true', async () => {
const txParams = {
operator: context.accounts.owner,
from: context.accounts.owner.address,
to: deployedContracts.tokenReceiverWithoutLSP1.address,
amount: transferAmount,
allowNonLSP1Recipient: true,
force: true,
data: expectedData,
};

Expand All @@ -947,20 +947,20 @@ export const shouldBehaveLikeLSP7CompatibleERC20 = (
txParams.from,
txParams.to,
txParams.amount,
txParams.allowNonLSP1Recipient,
txParams.force,
txParams.data,
),
expectedData,
);
});

it('should NOT allow transfering the tokens with `allowNonLSP1Recipient` param = false', async () => {
it('should NOT allow transfering the tokens with `force` param = false', async () => {
const txParams = {
operator: context.accounts.owner,
from: context.accounts.owner.address,
to: deployedContracts.tokenReceiverWithoutLSP1.address,
amount: transferAmount,
allowNonLSP1Recipient: false,
force: false,
data: expectedData,
};

Expand All @@ -974,7 +974,7 @@ export const shouldBehaveLikeLSP7CompatibleERC20 = (
txParams.from,
txParams.to,
txParams.amount,
txParams.allowNonLSP1Recipient,
txParams.force,
txParams.data,
),
)
Expand All @@ -994,13 +994,13 @@ export const shouldBehaveLikeLSP7CompatibleERC20 = (

describe('when caller (msg.sender) is an operator (= Not the `from` address)', () => {
describe('when `to` is an EOA', () => {
it('should allow transfering the tokens with `allowNonLSP1Recipient` param = true', async () => {
it('should allow transfering the tokens with `force` param = true', async () => {
const txParams = {
operator: context.accounts.operator,
from: context.accounts.owner.address,
to: context.accounts.tokenReceiver.address,
amount: transferAmount,
allowNonLSP1Recipient: true,
force: true,
data: expectedData,
};

Expand All @@ -1013,20 +1013,20 @@ export const shouldBehaveLikeLSP7CompatibleERC20 = (
txParams.from,
txParams.to,
txParams.amount,
txParams.allowNonLSP1Recipient,
txParams.force,
txParams.data,
),
expectedData,
);
});

it('should NOT allow transfering the tokens with `allowNonLSP1Recipient` param = false', async () => {
it('should NOT allow transfering the tokens with `force` param = false', async () => {
const txParams = {
operator: context.accounts.operator,
from: context.accounts.owner.address,
to: context.accounts.tokenReceiver.address,
amount: transferAmount,
allowNonLSP1Recipient: false,
force: false,
data: expectedData,
};

Expand All @@ -1040,7 +1040,7 @@ export const shouldBehaveLikeLSP7CompatibleERC20 = (
txParams.from,
txParams.to,
txParams.amount,
txParams.allowNonLSP1Recipient,
txParams.force,
txParams.data,
),
)
Expand All @@ -1058,13 +1058,13 @@ export const shouldBehaveLikeLSP7CompatibleERC20 = (

describe('when `to` is a contract', () => {
describe('when receiving contract supports LSP1', () => {
it('should allow transfering the tokens with `allowNonLSP1Recipient` param = true', async () => {
it('should allow transfering the tokens with `force` param = true', async () => {
const txParams = {
operator: context.accounts.operator,
from: context.accounts.owner.address,
to: deployedContracts.tokenReceiverWithLSP1.address,
amount: transferAmount,
allowNonLSP1Recipient: true,
force: true,
data: expectedData,
};

Expand All @@ -1077,20 +1077,20 @@ export const shouldBehaveLikeLSP7CompatibleERC20 = (
txParams.from,
txParams.to,
txParams.amount,
txParams.allowNonLSP1Recipient,
txParams.force,
txParams.data,
),
expectedData,
);
});

it('should allow transfering the tokens with `allowNonLSP1Recipient` param = false', async () => {
it('should allow transfering the tokens with `force` param = false', async () => {
const txParams = {
operator: context.accounts.operator,
from: context.accounts.owner.address,
to: deployedContracts.tokenReceiverWithLSP1.address,
amount: transferAmount,
allowNonLSP1Recipient: false,
force: false,
data: expectedData,
};

Expand All @@ -1103,7 +1103,7 @@ export const shouldBehaveLikeLSP7CompatibleERC20 = (
txParams.from,
txParams.to,
txParams.amount,
txParams.allowNonLSP1Recipient,
txParams.force,
txParams.data,
),
expectedData,
Expand All @@ -1112,13 +1112,13 @@ export const shouldBehaveLikeLSP7CompatibleERC20 = (
});

describe('when receiving contract does not support LSP1', () => {
it('should allow transfering the tokens with `allowNonLSP1Recipient` param = true', async () => {
it('should allow transfering the tokens with `force` param = true', async () => {
const txParams = {
operator: context.accounts.operator,
from: context.accounts.owner.address,
to: deployedContracts.tokenReceiverWithoutLSP1.address,
amount: transferAmount,
allowNonLSP1Recipient: true,
force: true,
data: expectedData,
};

Expand All @@ -1131,20 +1131,20 @@ export const shouldBehaveLikeLSP7CompatibleERC20 = (
txParams.from,
txParams.to,
txParams.amount,
txParams.allowNonLSP1Recipient,
txParams.force,
txParams.data,
),
expectedData,
);
});

it('should NOT allow transfering the tokens with `allowNonLSP1Recipient` param = false', async () => {
it('should NOT allow transfering the tokens with `force` param = false', async () => {
const txParams = {
operator: context.accounts.operator,
from: context.accounts.owner.address,
to: deployedContracts.tokenReceiverWithoutLSP1.address,
amount: transferAmount,
allowNonLSP1Recipient: false,
force: false,
data: expectedData,
};

Expand All @@ -1158,7 +1158,7 @@ export const shouldBehaveLikeLSP7CompatibleERC20 = (
txParams.from,
txParams.to,
txParams.amount,
txParams.allowNonLSP1Recipient,
txParams.force,
txParams.data,
),
)
Expand Down Expand Up @@ -1189,7 +1189,7 @@ export const shouldBehaveLikeLSP7CompatibleERC20 = (
from: context.accounts.owner.address,
to: deployedContracts.tokenReceiverWithoutLSP1.address,
amount: ownerBalance.add(1),
allowNonLSP1Recipient: true,
force: true,
data: expectedData,
};

Expand All @@ -1203,7 +1203,7 @@ export const shouldBehaveLikeLSP7CompatibleERC20 = (
txParams.from,
txParams.to,
txParams.amount,
txParams.allowNonLSP1Recipient,
txParams.force,
txParams.data,
),
)
Expand All @@ -1230,7 +1230,7 @@ export const shouldBehaveLikeLSP7CompatibleERC20 = (
from: context.accounts.owner.address,
to: deployedContracts.tokenReceiverWithoutLSP1.address,
amount: ownerBalance.add(1),
allowNonLSP1Recipient: true,
force: true,
data: expectedData,
};

Expand All @@ -1244,7 +1244,7 @@ export const shouldBehaveLikeLSP7CompatibleERC20 = (
txParams.from,
txParams.to,
txParams.amount,
txParams.allowNonLSP1Recipient,
txParams.force,
txParams.data,
),
)
Expand Down
Loading

0 comments on commit 7b97ed9

Please sign in to comment.