From 1c1c9ab635c83138823ddbe0f18aa314c4690a0d Mon Sep 17 00:00:00 2001 From: Martin Macharia Date: Thu, 21 Sep 2023 15:39:04 +0200 Subject: [PATCH] Remove unnecessary initGenesisState check (#9027) --- framework/src/modules/token/module.ts | 6 ------ .../modules/token/init_genesis_state_fixture.ts | 16 ---------------- 2 files changed, 22 deletions(-) diff --git a/framework/src/modules/token/module.ts b/framework/src/modules/token/module.ts index 2abb8b71a53..c6e46815a6a 100644 --- a/framework/src/modules/token/module.ts +++ b/framework/src/modules/token/module.ts @@ -286,12 +286,6 @@ export class TokenModule extends BaseInteroperableModule { )} has duplicate module in locked balances.`, ); } - // Validate userSubstore not to be empty - if (userData.lockedBalances.length === 0 && userData.availableBalance === BigInt(0)) { - throw new Error( - `Address ${address.getLisk32AddressFromAddress(userData.address)} has empty data.`, - ); - } await userStore.save(context, userData.address, userData.tokenID, userData); } diff --git a/framework/test/unit/modules/token/init_genesis_state_fixture.ts b/framework/test/unit/modules/token/init_genesis_state_fixture.ts index c71ac048dbd..1c508242771 100644 --- a/framework/test/unit/modules/token/init_genesis_state_fixture.ts +++ b/framework/test/unit/modules/token/init_genesis_state_fixture.ts @@ -205,22 +205,6 @@ export const invalidGenesisAssets = [ }, 'contains 0 amount locked balance', ], - [ - 'Empty account on userSubstore', - { - ...validData, - userSubstore: [ - ...validData.userSubstore, - { - address: Buffer.alloc(20, 2), - tokenID: Buffer.from([0, 0, 0, 0, 0, 0, 0, 0]), - availableBalance: BigInt('0'), - lockedBalances: [], - }, - ], - }, - 'has empty data', - ], [ 'Duplicate supply store', {