Skip to content

Commit

Permalink
refactor(derived-leaves): remove createMayUseToken function and simpl…
Browse files Browse the repository at this point in the history
…ify MayUseToken type

The createMayUseToken function was removed as it was not providing any additional functionality. The MayUseToken type was simplified to directly use the signable function with the parentsOwnToken and inheritFromParent fields of type Bool. This change reduces the complexity of the code without changing its behavior.
  • Loading branch information
MartinMinkov committed Jul 16, 2024
1 parent a99bf1a commit f81d228
Showing 1 changed file with 2 additions and 18 deletions.
20 changes: 2 additions & 18 deletions mina-transaction/derived-leaves.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,8 @@ function derivedLeafTypesSignable<Field, Bool>({
}),
Bool
),
MayUseToken: createMayUseToken(
signable({ parentsOwnToken: Bool, inheritFromParent: Bool }),
Bool
),
MayUseToken: signable({ parentsOwnToken: Bool, inheritFromParent: Bool }),
Bool,
ZkappUri: createZkappUri(Field, HashHelpers, packToFields),
};
}
Expand Down Expand Up @@ -199,20 +197,6 @@ function createAuthRequired<
};
}

type MayUseToken<Bool> = {
parentsOwnToken: Bool;
inheritFromParent: Bool;
};
function createMayUseToken<
Field,
Bool,
Base extends GenericSignable<MayUseToken<Bool>, MayUseToken<boolean>, Field>
>(base: Base, _Bool: GenericSignableBool<Field, Bool>) {
return {
...base,
};
}

function createZkappUri<Field>(
Field: GenericSignableField<Field>,
HashHelpers: HashHelpers<Field>,
Expand Down

0 comments on commit f81d228

Please sign in to comment.