Skip to content

Commit

Permalink
fix(dev-cli): fixed issue with setting memory limit tag during ao-pub…
Browse files Browse the repository at this point in the history
…lish #1028
  • Loading branch information
PeterFarber committed Oct 14, 2024
1 parent 8c40d91 commit b30ec6c
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions dev-cli/src/commands/publish.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ async function GetMemoryLimit () {
} catch {
return memoryLimit
}

if (config) {
switch (config.preset) {
case 'xs':
Expand All @@ -82,8 +81,9 @@ async function GetMemoryLimit () {
break
}
}
if (config?.memory_limit) {
memoryLimit = `${config.memoryLimit}-b`

if (config?.maximum_memory) {
memoryLimit = `${config.maximum_memory}-b`
}
return memoryLimit
}
Expand All @@ -97,8 +97,12 @@ async function GetMemoryLimit () {
*/

export async function publish ({ wallet, bundler, tag, value }, contractWasmPath) {
tag.push('Memory-Limit')
value.push(await GetMemoryLimit())
tag = tag || []
value = value || []
if (!tag.includes('Memory-Limit')) {
tag.push('Memory-Limit')
value.push(await GetMemoryLimit())
}
const cmdArgs = [
...walletArgs(wallet),
...bundlerArgs(bundler),
Expand Down

0 comments on commit b30ec6c

Please sign in to comment.