Skip to content

Commit

Permalink
fix(account-update.ts): remove provablePure from MayUseToken type def…
Browse files Browse the repository at this point in the history
…inition

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.
  • Loading branch information
MartinMinkov committed Jul 10, 2024
1 parent ded6b4f commit c177ddf
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions src/lib/mina/account-update.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
2 changes: 1 addition & 1 deletion src/lib/mina/account-update.unit-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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),
});
Expand Down

0 comments on commit c177ddf

Please sign in to comment.