From c177ddf6da1addc37c8d544423a699a179a18642 Mon Sep 17 00:00:00 2001 From: Martin Minkov Date: Wed, 10 Jul 2024 16:49:13 -0700 Subject: [PATCH] fix(account-update.ts): remove provablePure from MayUseToken type definition refactor(account-update.ts): simplify MayUseToken type by using BaseMayUseToken directly test(account-update.unit-test.ts): update MayUseToken type check to use AccountUpdate.MayUseToken.type.check instead of AccountUpdate.MayUseToken.check The changes remove the provablePure wrapper from the MayUseToken type definition and simplify it by using the BaseMayUseToken directly. This is done to fix an issue and simplify the type definition. The unit test is also updated to use the correct type check method after the refactoring. --- src/lib/mina/account-update.ts | 3 +-- src/lib/mina/account-update.unit-test.ts | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/lib/mina/account-update.ts b/src/lib/mina/account-update.ts index c07390b21f..bbf73fcece 100644 --- a/src/lib/mina/account-update.ts +++ b/src/lib/mina/account-update.ts @@ -159,8 +159,7 @@ const Actions = { type MayUseToken = BaseMayUseToken; const MayUseToken = { - ...BaseMayUseToken, - type: provablePure({ parentsOwnToken: Bool, inheritFromParent: Bool }), + type: BaseMayUseToken, No: { parentsOwnToken: Bool(false), inheritFromParent: Bool(false), diff --git a/src/lib/mina/account-update.unit-test.ts b/src/lib/mina/account-update.unit-test.ts index 61b55f6e76..28c64d1a46 100644 --- a/src/lib/mina/account-update.unit-test.ts +++ b/src/lib/mina/account-update.unit-test.ts @@ -163,7 +163,7 @@ function createAccountUpdateWithMayUseToken( // throws an error when both flags are true in check method { expect(() => { - AccountUpdate.MayUseToken.check({ + AccountUpdate.MayUseToken.type.check({ parentsOwnToken: Bool(true), inheritFromParent: Bool(true), });