diff --git a/packages/orchestrator/src/services/contract-simulate/index.ts b/packages/orchestrator/src/services/contract-simulate/index.ts index 61e0674..c391966 100644 --- a/packages/orchestrator/src/services/contract-simulate/index.ts +++ b/packages/orchestrator/src/services/contract-simulate/index.ts @@ -97,6 +97,12 @@ class ContractSimulator { static async loadStateAndCode(fileName: string, contractAddress: string) { const code = readFileSync(path.join(__dirname, `wasm/${fileName}.wasm`)); + const oldCode = readFileSync( + path.join( + os.homedir(), + `${env.server.storageDirName}/data/final/${contractAddress}` + ) + ); const state = readFileSync( path.join( os.homedir(), @@ -105,7 +111,7 @@ class ContractSimulator { ); const { codeId } = await this.simulateClient.upload( this.sender, - code, + oldCode, "auto" ); const raw = SortedMap.rawPack( @@ -113,7 +119,7 @@ class ContractSimulator { compare ); await this.simulateClient.loadContract( - env.cosmos.appBitcoin, + contractAddress, { codeId: codeId, admin: this.sender, @@ -123,6 +129,18 @@ class ContractSimulator { }, raw ); + const { codeId: newCodeId } = await this.simulateClient.upload( + this.sender, + code, + "auto" + ); + await this.simulateClient.migrate( + this.sender, + contractAddress, + newCodeId, + {}, + "auto" + ); } static copyFolderContents = (source: string, destination: string) => { diff --git a/packages/orchestrator/src/services/contract-simulate/wasm/cw-app-bitcoin.wasm b/packages/orchestrator/src/services/contract-simulate/wasm/cw-app-bitcoin.wasm index 369789f..90ed159 100644 Binary files a/packages/orchestrator/src/services/contract-simulate/wasm/cw-app-bitcoin.wasm and b/packages/orchestrator/src/services/contract-simulate/wasm/cw-app-bitcoin.wasm differ diff --git a/packages/orchestrator/src/services/signer/index.ts b/packages/orchestrator/src/services/signer/index.ts index 78b0cfb..85cbed8 100644 --- a/packages/orchestrator/src/services/signer/index.ts +++ b/packages/orchestrator/src/services/signer/index.ts @@ -128,6 +128,7 @@ class SignerService implements RelayerInterface { } } catch (err) { this.logger.error(`[START_CHECKPOINT_SIGNING] Error:`, err); + console.log(err); } await setTimeout(ITERATION_DELAY.RELAY_SIGNATURES_INTERVAL);