Skip to content

Commit

Permalink
Fixes support for authorizeUpgrade using checkVersion
Browse files Browse the repository at this point in the history
  • Loading branch information
crystalin committed Nov 29, 2023
1 parent f3991e1 commit c7e12ff
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ export class AuthorizeUpgradeManipulator implements StateManipulator {
if (key.startsWith(this.lastRelayChainBlockNumberKey)) {
debug(`Adding Authorized Upgrade Hash: ${this.runtimeHash}`);
return {
action: "keep" as Action,
action: "remove" as Action,
extraLines: [
{
key: this.storageKey,
value: this.runtimeHash,
value: `${this.runtimeHash}01`, // 01 for "true" check version
},
],
};
Expand Down
2 changes: 1 addition & 1 deletion src/libs/helpers/state-manipulator/genesis-parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export interface StateManipulator {

// Will get executed for each line of the state file during the write phase
// Can decide to remove/keep the original line and also add extra lines
processWrite: (line: StateLine) => { action: Action; extraLines?: StateLine[] } | undefined;
processWrite: (line: StateLine) => { action: Action; extraLines?: StateLine[] } | undefined | void;
}

export function encodeStorageKey(module, name) {
Expand Down
2 changes: 1 addition & 1 deletion src/tools/export-state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ async function main() {
if (line.key.startsWith(storagePrefix)) {
storageCount[storagePrefix] += 1n;
storageKeySize[storagePrefix] = line.key.length / 2 - 1;
storageSize[storagePrefix] += BigInt(line.value.length / 2) - 1n;
storageSize[storagePrefix] += BigInt(line.key.length / 2) + BigInt(line.value.length / 2) - 2n;
}
}
}
Expand Down

0 comments on commit c7e12ff

Please sign in to comment.