Skip to content

Commit

Permalink
TS codegen to not show internal method
Browse files Browse the repository at this point in the history
  • Loading branch information
rahul-kothari committed Jan 22, 2024
1 parent 7f88455 commit 862cf1e
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 13 deletions.
12 changes: 0 additions & 12 deletions yarn-project/end-to-end/src/e2e_lending_contract.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -250,18 +250,6 @@ describe('e2e_lending_contract', () => {
.send(),
);
});
describe('failure cases', () => {
it('calling internal _deposit function directly', async () => {
// Try to call the internal `_deposit` function directly
// This should:
// - not change any storage values.
// - fail

await expect(
lendingContract.methods._deposit(lendingAccount.address.toField(), 42n, collateralAsset.address).simulate(),
).rejects.toThrow();
});
});
});

describe('Borrow', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ function generateAbiStatement(name: string, artifactImportPath: string) {
* @returns The corresponding ts code.
*/
export function generateTypescriptContractInterface(input: ContractArtifact, artifactImportPath?: string) {
const methods = input.functions.filter(f => f.name !== 'constructor').map(generateMethod);
const methods = input.functions.filter(f => f.name !== 'constructor' && !f.isInternal).map(generateMethod);
const deploy = artifactImportPath && generateDeploy(input);
const ctor = artifactImportPath && generateConstructor(input.name);
const at = artifactImportPath && generateAt(input.name);
Expand Down

0 comments on commit 862cf1e

Please sign in to comment.