Skip to content

Commit

Permalink
improve: outstanding comments (#668)
Browse files Browse the repository at this point in the history
  • Loading branch information
james-a-morris authored Jun 24, 2024
1 parent 43a2cdf commit b36680f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@across-protocol/sdk",
"author": "UMA Team",
"version": "3.1.1",
"version": "3.1.2",
"license": "AGPL-3.0",
"homepage": "https://docs.across.to/reference/sdk",
"files": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,7 @@ export class AcrossConfigStoreClient extends BaseAbstractClient {
// leading and trailing quotes, as well as leading and trailing whitespace. We also need to
// check for commas between the numbers. Alternatively, this can be an empty array.
if (!/^\s*["']?\[(\d+(,\d+)*)?\]["']?\s*$/.test(args.value)) {
this.logger.warn({ at: "ConfigStore", message: `The array ${args.value} is invalid.` });
this.logger.warn({ at: "ConfigStore", message: `The lite chain indices array ${args.value} is invalid.` });
// If not a valid array, skip.
continue;
}
Expand Down
11 changes: 6 additions & 5 deletions test/SpokePoolClient.v3Events.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,24 +136,25 @@ describe("SpokePoolClient: Event Filtering", function () {
});

it("Correctly sets the `originatesFromLiteChain` flag by using `doesDepositOriginateFromLiteChain`", async function () {
// There's a nuanced issue with the mock config store's event manager so we need to mock a 2 second delay
// so that the block timestamps are different.

// Update the config store to set the originChainId as a lite chain.
configStoreClient.updateGlobalConfig(
GLOBAL_CONFIG_STORE_KEYS.LITE_CHAIN_ID_INDICES,
JSON.stringify([originChainId])
);
await configStoreClient.update();
// Sleep for 2 seconds to ensure that the block timestamp is different.
await new Promise((resolve) => setTimeout(resolve, 2000));
// Update the config store to set the originChainId as a non-lite chain.
configStoreClient.updateGlobalConfig(GLOBAL_CONFIG_STORE_KEYS.LITE_CHAIN_ID_INDICES, JSON.stringify([]));
await configStoreClient.update();

// Confirm that the config store client has two updates.
expect(configStoreClient.liteChainIndicesUpdates.length).to.equal(2);
const [liteChainIndicesUpdate1, liteChainIndicesUpdate2] = configStoreClient.liteChainIndicesUpdates;

// There's a nuanced issue with the mock config store's event manager so we need to mock a 2 second delay
// so that the block timestamps are different. If this issue is resolved, this shouldn't impact this test
// because the second event's timestamp should be greater than the first event's timestamp anyway.
configStoreClient.liteChainIndicesUpdates[1].timestamp += 2;

// Confirm that the two updates have different timestamps.
expect(liteChainIndicesUpdate1.timestamp).to.not.equal(liteChainIndicesUpdate2.timestamp);

Expand Down

0 comments on commit b36680f

Please sign in to comment.