Skip to content
This repository has been archived by the owner on Jun 11, 2024. It is now read-only.

Commit

Permalink
Remove unnecessary initGenesisState check (#9027)
Browse files Browse the repository at this point in the history
  • Loading branch information
mosmartin authored Sep 21, 2023
1 parent 2bdcc73 commit 1c1c9ab
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 22 deletions.
6 changes: 0 additions & 6 deletions framework/src/modules/token/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
16 changes: 0 additions & 16 deletions framework/test/unit/modules/token/init_genesis_state_fixture.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
{
Expand Down

0 comments on commit 1c1c9ab

Please sign in to comment.