Skip to content

Commit

Permalink
Merge branch 'andrius/relay-upgrade' into 'main'
Browse files Browse the repository at this point in the history
Add support for Relay contract upgrade

See merge request flarenetwork/ftso-scaling!137
  • Loading branch information
adg-flare committed Oct 10, 2024
2 parents 400e919 + ee1e126 commit 7738eec
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
17 changes: 16 additions & 1 deletion libs/ftso-core/src/IndexerClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,22 @@ export class IndexerClient {
): Promise<IndexerResponse<SigningPolicyInitialized[]>> {
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,
Expand Down
2 changes: 1 addition & 1 deletion libs/ftso-core/src/configs/networks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: "" },
Expand Down

0 comments on commit 7738eec

Please sign in to comment.