diff --git a/tests/LSP17ContractExtension/LSP17ExtendableTokens.behaviour.ts b/tests/LSP17ContractExtension/LSP17ExtendableTokens.behaviour.ts index 095008e08..e6e20a87d 100644 --- a/tests/LSP17ContractExtension/LSP17ExtendableTokens.behaviour.ts +++ b/tests/LSP17ContractExtension/LSP17ExtendableTokens.behaviour.ts @@ -145,30 +145,6 @@ export const shouldBehaveLikeLSP17 = (buildContext: () => Promise { - describe('when making a call without any value', () => { - it('should revert', async () => { - await expect( - context.accounts[0].sendTransaction({ - to: context.contract.address, - }), - ).to.be.revertedWithCustomError(context.contract, 'InvalidFunctionSelector'); - }); - }); - - describe('when making a call with sending value', () => { - it('should revert', async () => { - const amountSent = 200; - await expect( - context.accounts[0].sendTransaction({ - to: context.contract.address, - value: amountSent, - }), - ).to.be.revertedWithCustomError(context.contract, 'InvalidFunctionSelector'); - }); - }); - }); - describe('when calling the contract with calldata', () => { describe("when calling method that doesn't exist", () => { describe('when there is no extension for the function called', () => { diff --git a/tests/LSP7DigitalAsset/LSP7DigitalAsset.behaviour.ts b/tests/LSP7DigitalAsset/LSP7DigitalAsset.behaviour.ts index d965032e1..5e57cc931 100644 --- a/tests/LSP7DigitalAsset/LSP7DigitalAsset.behaviour.ts +++ b/tests/LSP7DigitalAsset/LSP7DigitalAsset.behaviour.ts @@ -2144,6 +2144,32 @@ export const shouldBehaveLikeLSP7 = (buildContext: () => Promise { + describe('when making a call without any value', () => { + it('should revert', async () => { + await expect( + context.accounts.anyone.sendTransaction({ + to: context.lsp7.address, + }), + ) + .to.be.revertedWithCustomError(context.lsp7, 'InvalidFunctionSelector') + .withArgs('0x00000000'); + }); + }); + + describe('when making a call with sending value', () => { + it('should revert', async () => { + const amountSent = 200; + await expect( + context.accounts.anyone.sendTransaction({ + to: context.lsp7.address, + value: amountSent, + }), + ).to.be.revertedWithCustomError(context.lsp7, 'LSP7TokenContractCannotHoldValue'); + }); + }); + }); }; export type LSP7InitializeTestContext = { diff --git a/tests/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAsset.behaviour.ts b/tests/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAsset.behaviour.ts index ecf3bb2f1..df1c4a9af 100644 --- a/tests/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAsset.behaviour.ts +++ b/tests/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAsset.behaviour.ts @@ -1765,6 +1765,32 @@ export const shouldBehaveLikeLSP8 = (buildContext: () => Promise { + describe('when making a call without any value', () => { + it('should revert', async () => { + await expect( + context.accounts.anyone.sendTransaction({ + to: context.lsp8.address, + }), + ) + .to.be.revertedWithCustomError(context.lsp8, 'InvalidFunctionSelector') + .withArgs('0x00000000'); + }); + }); + + describe('when making a call with sending value', () => { + it('should revert', async () => { + const amountSent = 200; + await expect( + context.accounts.anyone.sendTransaction({ + to: context.lsp8.address, + value: amountSent, + }), + ).to.be.revertedWithCustomError(context.lsp8, 'LSP8TokenContractCannotHoldValue'); + }); + }); + }); }; export type LSP8InitializeTestContext = {