Skip to content

Commit 1cb28ef

Browse files
authored
Merge pull request #64 from AztecProtocol/pw/param-rename
Renamed paramter
2 parents e942802 + 4c974e2 commit 1cb28ef

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
"rootDir": "./src"
3030
},
3131
"name": "@aztec/bridge-clients",
32-
"version": "0.1.36",
32+
"version": "0.1.37",
3333
"description": "This repo contains the solidity files and typescript helper class for all of the Aztec Connect Bridge Contracts",
3434
"repository": "[email protected]:AztecProtocol/aztec-connect-bridges.git",
3535
"license": "MIT",

src/client/element/element-bridge-data.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { ElementBridgeData } from './element-bridge-data';
1+
import { ChainProperties, ElementBridgeData } from './element-bridge-data';
22
import { BigNumber } from 'ethers';
33
import { randomBytes } from 'crypto';
44
import {
@@ -131,7 +131,7 @@ describe('element bridge data', () => {
131131
element: ElementBridge = elementBridge as any,
132132
balancer: IVault = balancerContract as any,
133133
rollup: RollupProcessor = rollupContract as any,
134-
chainProperties: { chunkSize: number } = { chunkSize: 10 },
134+
chainProperties: ChainProperties = { eventBatchSize: 10 },
135135
) => {
136136
ElementBridge__factory.connect = () => element as any;
137137
IVault__factory.connect = () => balancer as any;

src/client/element/element-bridge-data.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,11 @@ export type FundManagement = {
3434
};
3535

3636
// Some operations on this class require us to scan back over the blockchain
37-
// to find published events. This is done in batches of blocks. The chunk size in this set of properties
37+
// to find published events. This is done in batches of blocks. The batch size in this set of properties
3838
// determines how many blocks to request in each batch.
3939
// Users of this class can customise this to their provider requirements
4040
export type ChainProperties = {
41-
chunkSize: number;
41+
eventBatchSize: number;
4242
};
4343

4444
interface EventBlock {
@@ -84,7 +84,7 @@ export class ElementBridgeData implements BridgeDataFieldGetters {
8484
elementBridgeAddress: EthAddress,
8585
balancerAddress: EthAddress,
8686
rollupContractAddress: EthAddress,
87-
chainProperties: ChainProperties = { chunkSize: 10000 },
87+
chainProperties: ChainProperties = { eventBatchSize: 10000 },
8888
) {
8989
const ethersProvider = createWeb3Provider(provider);
9090
const elementBridgeContract = ElementBridge__factory.connect(elementBridgeAddress.toString(), ethersProvider);
@@ -150,7 +150,7 @@ export class ElementBridgeData implements BridgeDataFieldGetters {
150150
}
151151

152152
let end = latestBlockNumber;
153-
let start = end - (this.chainProperties.chunkSize - 1);
153+
let start = end - (this.chainProperties.eventBatchSize - 1);
154154
start = Math.max(start, earliestBlockNumber);
155155

156156
while (end > earliestBlockNumber) {
@@ -171,7 +171,7 @@ export class ElementBridgeData implements BridgeDataFieldGetters {
171171

172172
// if we didn't find an event then go round again but search further back in time
173173
end = start - 1;
174-
start = end - (this.chainProperties.chunkSize - 1);
174+
start = end - (this.chainProperties.eventBatchSize - 1);
175175
start = Math.max(start, earliestBlockNumber);
176176
}
177177
}

0 commit comments

Comments
 (0)