Skip to content

Commit

Permalink
ci: Reset version and add logging to detect race condition
Browse files Browse the repository at this point in the history
  • Loading branch information
nvsriram committed Dec 6, 2024
1 parent e617f41 commit 8a4448c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 4 additions & 0 deletions cli/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,9 @@ yargs(hideBin(process.argv))
// TODO: is there an easier way to do this?
const { ntt: upgraded } = await nttFromManager(ch, chainConfig.manager);

console.log("UPGRADE -> CHAINCONFIG BEFORE:", JSON.stringify(chainConfig));
chainConfig.version = getVersion(chain, upgraded)
console.log("UPGRADE -> CHAINCONFIG AFTER:", JSON.stringify(chainConfig));
fs.writeFileSync(path, JSON.stringify(deployments, null, 2));

console.log(`Successfully upgraded ${chain} to version ${toVersion || 'local version'}`);
Expand Down Expand Up @@ -1721,6 +1723,7 @@ async function pullChainConfig<N extends Network, C extends Chain>(
const pauser = await ntt.getPauser();

const version = getVersion(manager.chain, ntt);
console.log("PULLCHAINCONFIG VERSION:", version);

const transceiverPauser = await ntt.getTransceiver(0).then((t) => t?.getPauser() ?? null);

Expand All @@ -1740,6 +1743,7 @@ async function pullChainConfig<N extends Network, C extends Chain>(
inbound: {},
},
};
console.log("PULLCHAINCONFIG CONFIG:", JSON.stringify(config, null, 2));
if (transceiverPauser) {
config.transceivers.wormhole.pauser = transceiverPauser.toString();
}
Expand Down
3 changes: 2 additions & 1 deletion solana/ts/sdk/ntt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -618,8 +618,9 @@ export class SolanaNtt<N extends Network, C extends SolanaChains>
sender ? new SolanaAddress(sender).unwrap() : undefined
);
} catch (e) {
console.log("NOT DEPLOYED!");
// This might happen if e.g. the program is not deployed yet.
const version = "2.0.0";
const version = "3.0.0";
return version;
}
}
Expand Down

0 comments on commit 8a4448c

Please sign in to comment.