diff --git a/src/boilerplate/orchestration/javascript/raw/boilerplate-generator.ts b/src/boilerplate/orchestration/javascript/raw/boilerplate-generator.ts index f4353d6cc..7b7cf8b8b 100644 --- a/src/boilerplate/orchestration/javascript/raw/boilerplate-generator.ts +++ b/src/boilerplate/orchestration/javascript/raw/boilerplate-generator.ts @@ -582,10 +582,17 @@ encryptBackupPreimage = { let plainText; let varName = mappingName ? mappingName : stateName; if (mappingKey){ - plainText = `[BigInt(${saltName}.hex(32)), BigInt(${mappingKey}.hex(32)), - BigInt(generalise(${stateName}_stateVarIdInit).hex(32)), - ${valueName}]`; - varName += ` a`; + if (mappingKey === 'msg'){ + plainText = `[BigInt(${saltName}.hex(32)), BigInt(${stateName}_stateVarId_key.hex(32)), + BigInt(generalise(${stateName}_stateVarIdInit).hex(32)), + ${valueName}]`; + varName += ` a`; + } else { + plainText = `[BigInt(${saltName}.hex(32)), BigInt(${mappingKey}.hex(32)), + BigInt(generalise(${stateName}_stateVarIdInit).hex(32)), + ${valueName}]`; + varName += ` a`; + } } else{ plainText = `[BigInt(${saltName}.hex(32)), BigInt(${stateName}_stateVarId), ${valueName}]`;