Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: mocks can be deployed with libs #68

Merged
merged 1 commit into from
Sep 7, 2021
Merged

Conversation

0xGorilla
Copy link
Member

Description
Mocks now receive the same arguments as ethers.getContractFactory and it forwards them to the real function

Comment on lines +10 to +18
it('should be able to use libraries', async () => {
const testLibrary = await (await ethers.getContractFactory('TestLibrary')).deploy();
const librarian = await (
await smock.mock<Librarian__factory>('Librarian', {
libraries: {
TestLibrary: testLibrary.address,
},
})
).deploy();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀


chai.use(smock.matchers);

describe.only('Mock: Initialization', () => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😠

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Solved, forced push commit

Copy link
Member

@wei3erHase wei3erHase left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

very clear work ape! take a look at the tests, there's some warnings
i don't think is necessary to mock/fake libraries but if that's your objective u should go for it
🥇

@0xGorilla 0xGorilla merged commit 620f5a3 into main Sep 7, 2021
@0xGorilla 0xGorilla deleted the feat/lib-deployment branch September 7, 2021 14:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants