Skip to content
This repository has been archived by the owner on Sep 28, 2022. It is now read-only.

Commit

Permalink
add test for smartContract.addressOverrides and plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
levity committed Dec 2, 2019
1 parent eeab2b3 commit 5f292b1
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions packages/dai/test/Maker.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,3 +78,27 @@ test('injected provider is called', async () => {

expect(mockSend).toBeCalled();
});

test('smartContract.addressOverrides can override plugins', async () => {
const maker = await Maker.create('test', {
plugins: [
{
addConfig: () => ({
smartContract: {
addContracts: {
FOO: { address: '0xfoo', abi: [] }
}
}
})
}
],
smartContract: {
addressOverrides: { FOO: '0xfoo2' }
},
log: false
});

// addressOverrides should be able to modify contracts added by plugins
const addresses = maker.service('smartContract').getContractAddresses();
expect(addresses.FOO).toEqual('0xfoo2');
});

0 comments on commit 5f292b1

Please sign in to comment.