From fc580a37f8a8d4757aa91b212b7cecbe27b161f1 Mon Sep 17 00:00:00 2001 From: CJ42 Date: Thu, 23 Nov 2023 15:28:44 +0000 Subject: [PATCH] test: fix remaining tests that deploy tokens --- tests/Benchmark.test.ts | 11 +++++++++++ .../LSP1UniversalReceiverDelegateUP.behaviour.ts | 12 ++++++++++++ .../LSP1UniversalReceiverDelegateVault.behaviour.ts | 11 +++++++++++ .../LSP6/Interactions/AllowedFunctions.test.ts | 3 +++ .../LSP6/Interactions/AllowedStandards.test.ts | 4 ++++ .../LSP6/Interactions/ERC725XExecuteBatch.test.ts | 6 +++++- .../Interactions/PermissionTransferValue.test.ts | 5 +++++ .../Interactions/AllowedFunctions.test.ts | 3 +++ .../Interactions/AllowedStandards.test.ts | 4 ++++ .../LSP6KeyManager/Interactions/BatchExecute.test.ts | 11 ++++++++++- .../Interactions/PermissionTransferValue.test.ts | 5 +++++ tests/LSP6KeyManager/LSP6ControlledToken.test.ts | 10 +++++++++- tests/LSP6KeyManager/Relay/ExecuteRelayCall.test.ts | 2 ++ .../standard/LSP7CompatibleERC20.test.ts | 3 ++- 14 files changed, 86 insertions(+), 4 deletions(-) diff --git a/tests/Benchmark.test.ts b/tests/Benchmark.test.ts index 302f0a722..441a173f7 100644 --- a/tests/Benchmark.test.ts +++ b/tests/Benchmark.test.ts @@ -22,6 +22,7 @@ import { PERMISSIONS, CALLTYPE, LSP8_TOKEN_ID_TYPES, + LSP4_TOKEN_TYPES, } from '../constants'; import { LSP6TestContext } from './utils/context'; import { setupKeyManager, setupProfileWithKeyManagerWithURD } from './utils/fixtures'; @@ -129,6 +130,7 @@ describe('⛽📊 Gas Benchmark', () => { 'MTKN', accounts[0].address, false, + LSP4_TOKEN_TYPES.TOKEN, ); const lsp7DeployTransaction = lsp7Mintable.deployTransaction; @@ -142,6 +144,7 @@ describe('⛽📊 Gas Benchmark', () => { 'MNFT', accounts[0].address, LSP8_TOKEN_ID_TYPES.NUMBER, + LSP4_TOKEN_TYPES.NFT, ); const lsp8DeployTransaction = lsp8Mintable.deployTransaction; @@ -552,6 +555,7 @@ describe('⛽📊 Gas Benchmark', () => { 'MTKN', context.mainController.address, false, + LSP4_TOKEN_TYPES.TOKEN, ); // deploy a LSP8 token @@ -560,6 +564,7 @@ describe('⛽📊 Gas Benchmark', () => { 'MNFT', context.mainController.address, LSP8_TOKEN_ID_TYPES.UNIQUE_ID, + LSP4_TOKEN_TYPES.NFT, ); universalProfile1 = await new UniversalProfile__factory(context.mainController).deploy( @@ -704,6 +709,7 @@ describe('⛽📊 Gas Benchmark', () => { 'MTC', context.mainController.address, false, + LSP4_TOKEN_TYPES.TOKEN, ); // deploy a LSP8 NFT @@ -712,6 +718,7 @@ describe('⛽📊 Gas Benchmark', () => { 'MNF', context.mainController.address, LSP8_TOKEN_ID_TYPES.UNIQUE_ID, + LSP4_TOKEN_TYPES.NFT, ); // mint some tokens to the UP @@ -891,6 +898,7 @@ describe('⛽📊 Gas Benchmark', () => { 'MTC', context.mainController.address, false, + LSP4_TOKEN_TYPES.TOKEN, ); lsp7LyxDai = await new LSP7Mintable__factory(context.mainController).deploy( @@ -898,6 +906,7 @@ describe('⛽📊 Gas Benchmark', () => { 'LDAI', context.mainController.address, false, + LSP4_TOKEN_TYPES.TOKEN, ); [lsp7MetaCoin, lsp7LyxDai].forEach(async (token) => { @@ -912,6 +921,7 @@ describe('⛽📊 Gas Benchmark', () => { 'MNF', context.mainController.address, LSP8_TOKEN_ID_TYPES.UNIQUE_ID, + LSP4_TOKEN_TYPES.NFT, ); lsp8LyxPunks = await new LSP8Mintable__factory(context.mainController).deploy( @@ -919,6 +929,7 @@ describe('⛽📊 Gas Benchmark', () => { 'LPK', context.mainController.address, LSP8_TOKEN_ID_TYPES.UNIQUE_ID, + LSP4_TOKEN_TYPES.NFT, ); [ diff --git a/tests/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateUP.behaviour.ts b/tests/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateUP.behaviour.ts index 20e758f48..be9afd648 100644 --- a/tests/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateUP.behaviour.ts +++ b/tests/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateUP.behaviour.ts @@ -36,6 +36,7 @@ import { OPERATION_TYPES, LSP1_TYPE_IDS, LSP8_TOKEN_ID_TYPES, + LSP4_TOKEN_TYPES, } from '../../constants'; // fixtures @@ -245,18 +246,21 @@ export const shouldBehaveLikeLSP1Delegate = ( 'TokenAlpha', 'TA', context.accounts.random.address, + LSP4_TOKEN_TYPES.TOKEN, ); lsp7TokenB = await new LSP7Tester__factory(context.accounts.random).deploy( 'TokenBeta', 'TB', context.accounts.random.address, + LSP4_TOKEN_TYPES.TOKEN, ); lsp7TokenC = await new LSP7Tester__factory(context.accounts.random).deploy( 'TokenGamma', 'TA', context.accounts.random.address, + LSP4_TOKEN_TYPES.TOKEN, ); }); @@ -269,6 +273,7 @@ export const shouldBehaveLikeLSP1Delegate = ( 'LSP7 Token', 'TKN', context.universalProfile1.address, + LSP4_TOKEN_TYPES.TOKEN, ); }); @@ -931,6 +936,7 @@ export const shouldBehaveLikeLSP1Delegate = ( 'Example LSP7 token', 'EL7T', context.accounts.random.address, + LSP4_TOKEN_TYPES.TOKEN, ); }); @@ -1124,6 +1130,7 @@ export const shouldBehaveLikeLSP1Delegate = ( 'Example LSP7 token', 'EL7T', context.accounts.random.address, + LSP4_TOKEN_TYPES.TOKEN, ); arrayKey = ERC725YDataKeys.LSP5['LSP5ReceivedAssets[]'].length; @@ -1782,6 +1789,7 @@ export const shouldBehaveLikeLSP1Delegate = ( 'TA', context.accounts.random.address, LSP8_TOKEN_ID_TYPES.UNIQUE_ID, + LSP4_TOKEN_TYPES.NFT, ); lsp8TokenB = await new LSP8Tester__factory(context.accounts.random).deploy( @@ -1789,6 +1797,7 @@ export const shouldBehaveLikeLSP1Delegate = ( 'TB', context.accounts.random.address, LSP8_TOKEN_ID_TYPES.UNIQUE_ID, + LSP4_TOKEN_TYPES.NFT, ); lsp8TokenC = await new LSP8Tester__factory(context.accounts.random).deploy( @@ -1796,6 +1805,7 @@ export const shouldBehaveLikeLSP1Delegate = ( 'TA', context.accounts.random.address, LSP8_TOKEN_ID_TYPES.UNIQUE_ID, + LSP4_TOKEN_TYPES.NFT, ); }); @@ -3087,6 +3097,7 @@ export const shouldBehaveLikeLSP1Delegate = ( 'MyToken', 'MTK', context.universalProfile1.address, + LSP4_TOKEN_TYPES.TOKEN, ); expect(await LSP7.balanceOf(context.universalProfile1.address)).to.equal(1000); @@ -3119,6 +3130,7 @@ export const shouldBehaveLikeLSP1Delegate = ( 'MTK', context.universalProfile1.address, LSP8_TOKEN_ID_TYPES.NUMBER, + LSP4_TOKEN_TYPES.NFT, ); // Mint token for UP1 await LSP8.mint(context.universalProfile1.address, '0x' + '0'.repeat(64), true, '0x'); diff --git a/tests/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateVault.behaviour.ts b/tests/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateVault.behaviour.ts index a41f25b70..21dc57bbe 100644 --- a/tests/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateVault.behaviour.ts +++ b/tests/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateVault.behaviour.ts @@ -25,6 +25,7 @@ import { OPERATION_TYPES, LSP1_TYPE_IDS, LSP8_TOKEN_ID_TYPES, + LSP4_TOKEN_TYPES, } from '../../constants'; import { callPayload, getLSP5MapAndArrayKeysValue } from '../utils/fixtures'; import { BigNumber, BytesLike, Transaction } from 'ethers'; @@ -209,18 +210,21 @@ export const shouldBehaveLikeLSP1Delegate = (buildContext: () => Promise Promise Promise Promise Promise Promise Promise Promise Promise Promise Promise Promise Promise Promise Promise Promise Promise Promise { 'symbol', accounts[0].address, true, + LSP4_TOKEN_TYPES.TOKEN, ); const keyManager = await new LSP6KeyManager__factory(accounts[0]).deploy(lsp7.address); @@ -597,6 +604,7 @@ describe('When deploying LSP7 with LSP6 as owner', () => { 'NewTokenName', 'NewTokenSymbol', context.mainController.address, + LSP4_TOKEN_TYPES.TOKEN, ); // creating a payload to mint tokens in the new contract const mintPayload = newTokenContract.interface.encodeFunctionData('mint', [ diff --git a/tests/LSP6KeyManager/Relay/ExecuteRelayCall.test.ts b/tests/LSP6KeyManager/Relay/ExecuteRelayCall.test.ts index 97bcc5ff1..38a36bb75 100644 --- a/tests/LSP6KeyManager/Relay/ExecuteRelayCall.test.ts +++ b/tests/LSP6KeyManager/Relay/ExecuteRelayCall.test.ts @@ -21,6 +21,7 @@ import { PERMISSIONS, CALLTYPE, INTERFACE_IDS, + LSP4_TOKEN_TYPES, } from '../../../constants'; // helpers @@ -1379,6 +1380,7 @@ export const shouldBehaveLikeExecuteRelayCall = ( 'LSP7', context.universalProfile.address, false, + LSP4_TOKEN_TYPES.TOKEN, ); const permissionKeys = [ diff --git a/tests/LSP7DigitalAsset/standard/LSP7CompatibleERC20.test.ts b/tests/LSP7DigitalAsset/standard/LSP7CompatibleERC20.test.ts index c49853f0b..0c37f48ea 100644 --- a/tests/LSP7DigitalAsset/standard/LSP7CompatibleERC20.test.ts +++ b/tests/LSP7DigitalAsset/standard/LSP7CompatibleERC20.test.ts @@ -18,13 +18,14 @@ describe('LSP7CompatibleERC20 with constructor', () => { name: 'Compat for ERC20', symbol: 'NFT', newOwner: accounts.owner.address, + lsp4TokenType: LSP4_TOKEN_TYPES.TOKEN, }; const lsp7CompatibleERC20 = await new LSP7CompatibleERC20Tester__factory(accounts.owner).deploy( deployParams.name, deployParams.symbol, deployParams.newOwner, - LSP4_TOKEN_TYPES.TOKEN, + deployParams.lsp4TokenType, ); return {