Skip to content

Commit

Permalink
Merge d1719ef into e6ff309
Browse files Browse the repository at this point in the history
  • Loading branch information
sohkai committed Sep 2, 2019
2 parents e6ff309 + d1719ef commit f016f94
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
4 changes: 2 additions & 2 deletions packages/aragon-wrapper/src/index.js
Expand Up @@ -47,7 +47,7 @@ import {
includesAddress,
makeAddressMapProxy,
makeProxy,
makeProxyFromABI,
makeProxyFromAppABI,
AsyncRequestCache,
ANY_ENTITY
} from './utils'
Expand Down Expand Up @@ -1070,7 +1070,7 @@ export default class Aragon {
const app = apps.find((app) => addressesEqual(app.proxyAddress, proxyAddress))

// TODO: handle undefined (no proxy found), otherwise when calling app.proxyAddress next, it will throw
const appProxy = makeProxyFromABI(app.proxyAddress, app.abi, this.web3)
const appProxy = makeProxyFromAppABI(app.proxyAddress, app.abi, this.web3)

await appProxy.updateInitializationBlock()

Expand Down
6 changes: 3 additions & 3 deletions packages/aragon-wrapper/src/index.test.js
Expand Up @@ -1224,7 +1224,7 @@ test('should run the app and reply to a request', async (t) => {
proxyAddress: '0x789'
}
])
utilsStub.makeProxyFromABI = (proxyAddress) => ({
utilsStub.makeProxyFromAppABI = (proxyAddress) => ({
address: proxyAddress,
updateInitializationBlock: () => {}
})
Expand Down Expand Up @@ -1269,7 +1269,7 @@ test('should run the app and be able to shutdown', async (t) => {
proxyAddress: '0x789'
}
])
utilsStub.makeProxyFromABI = (proxyAddress) => ({
utilsStub.makeProxyFromAppABI = (proxyAddress) => ({
address: proxyAddress,
updateInitializationBlock: () => {}
})
Expand Down Expand Up @@ -1326,7 +1326,7 @@ test('should run the app and be able to shutdown and clear cache', async (t) =>
}
])

utilsStub.makeProxyFromABI = (proxyAddress) => ({
utilsStub.makeProxyFromAppABI = (proxyAddress) => ({
address: proxyAddress,
updateInitializationBlock: () => {}
})
Expand Down
6 changes: 6 additions & 0 deletions packages/aragon-wrapper/src/utils/index.js
Expand Up @@ -60,6 +60,12 @@ export function makeProxy (address, interfaceName, web3, options) {
return makeProxyFromABI(address, abi, web3, options)
}

const appProxyEventsAbi = getAbi('aragon/AppProxy').filter(({ type }) => type === 'event')
export function makeProxyFromAppABI (address, appAbi, web3, options) {
const appAbiWithProxyEvents = [].concat(appAbi, appProxyEventsAbi)
return makeProxyFromABI(address, appAbiWithProxyEvents, web3, options)
}

export function makeProxyFromABI (address, abi, web3, options) {
return new ContractProxy(address, abi, web3, options)
}
Expand Down

0 comments on commit f016f94

Please sign in to comment.