From ee1e126114dec2fd4c770e5048197e3661c356dc Mon Sep 17 00:00:00 2001 From: Andrius Date: Thu, 10 Oct 2024 14:09:52 +0000 Subject: [PATCH] Add support for Relay contract upgrade --- libs/ftso-core/src/IndexerClient.ts | 17 ++++++++++++++++- libs/ftso-core/src/configs/networks.ts | 2 +- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/libs/ftso-core/src/IndexerClient.ts b/libs/ftso-core/src/IndexerClient.ts index 65fb005e..0e7b9ac3 100644 --- a/libs/ftso-core/src/IndexerClient.ts +++ b/libs/ftso-core/src/IndexerClient.ts @@ -390,7 +390,22 @@ export class IndexerClient { ): Promise> { const eventName = SigningPolicyInitialized.eventName; const status = await this.ensureLowerBlock(fromStartTime); - const result = await this.queryEvents(CONTRACTS.Relay, eventName, fromStartTime); + + const result: TLPEvents[] = []; + + // TEMP CHANGE for upgrading Relay contract, can be removed in December 2024 + if (CONTRACTS.Relay.address == "0xA300E71257547e645CD7241987D3B75f2012E0E3") { + const oldRelay = { + ...CONTRACTS.Relay, + address: "0x32D46A1260BB2D8C9d5Ab1C9bBd7FF7D7CfaabCC", // Old Relay address for Coston + }; + + result.push(...(await this.queryEvents(oldRelay, eventName, fromStartTime))); + } + // END TEMP CHANGE + + result.push(...(await this.queryEvents(CONTRACTS.Relay, eventName, fromStartTime))); + const data = result.map(event => SigningPolicyInitialized.fromRawEvent(event)); return { status, diff --git a/libs/ftso-core/src/configs/networks.ts b/libs/ftso-core/src/configs/networks.ts index e4a606c5..a1d424ce 100644 --- a/libs/ftso-core/src/configs/networks.ts +++ b/libs/ftso-core/src/configs/networks.ts @@ -22,7 +22,7 @@ const COSTON_CONFIG: NetworkContractAddresses = { FtsoRewardOffersManager: { name: "FtsoRewardOffersManager", address: "0xC9534cB913150aD3e98D792857689B55e2404212" }, RewardManager: { name: "RewardManager", address: "0xA17197b7Bdff7Be7c3Da39ec08981FB716B70d3A" }, Submission: { name: "Submission", address: "0x2cA6571Daa15ce734Bbd0Bf27D5C9D16787fc33f" }, - Relay: { name: "Relay", address: "0x32D46A1260BB2D8C9d5Ab1C9bBd7FF7D7CfaabCC" }, + Relay: { name: "Relay", address: "0xA300E71257547e645CD7241987D3B75f2012E0E3" }, FlareSystemsCalculator: { name: "FlareSystemsCalculator", address: "0x43CBAB9C953F54533aadAf7ffCD13c30ec05Edc9" }, VoterRegistry: { name: "VoterRegistry", address: "0xE2c06DF29d175Aa0EcfcD10134eB96f8C94448A3" }, FtsoMerkleStructs: { name: "FtsoMerkleStructs", address: "" },