Skip to content

Commit 033b8d4

Browse files
authored
Merge pull request #527 from daostack/fetch-appropriate-package-version
Fetch correct package version for plugin manager
2 parents be6b241 + d72165e commit 033b8d4

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@daostack/arc.js",
3-
"version": "2.0.0-experimental.51",
3+
"version": "2.0.0-experimental.52",
44
"description": "",
55
"keywords": [],
66
"main": "dist/lib/index.js",

src/plugins/pluginManager/plugin.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,7 @@ export class PluginManagerPlugin extends ProposalPlugin<
165165

166166
public async createProposalTransaction(options: IProposalCreateOptionsPM): Promise<ITransaction> {
167167
const args = []
168+
const { address: pluginAddress } = (await this.fetchState())
168169

169170
if (options.add) {
170171

@@ -188,7 +189,8 @@ export class PluginManagerPlugin extends ProposalPlugin<
188189
const pluginData = abiInterface.functions.initialize.encode(initializeParams)
189190

190191
args.push(
191-
PACKAGE_VERSION,
192+
// NOTE: The next line is a workaround
193+
this.context.getContractInfo(pluginAddress).version.substring(9) <= '2' ? [0, 1, 2] : PACKAGE_VERSION,
192194
options.add.pluginName === 'Competition' ? 'ContributionRewardExt' : options.add.pluginName,
193195
pluginData,
194196
options.add.permissions
@@ -202,8 +204,6 @@ export class PluginManagerPlugin extends ProposalPlugin<
202204
)
203205
}
204206

205-
const { address: pluginAddress } = (await this.fetchState())
206-
207207
if (!options.descriptionHash) {
208208
options.descriptionHash = await this.context.saveIPFSData(options)
209209
}

0 commit comments

Comments
 (0)