@aztec/kv-store 0.80.0 → 0.81.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"l2_tips_store.d.ts","sourceRoot":"","sources":["../../src/stores/l2_tips_store.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,kBAAkB,EAClB,yBAAyB,EACzB,8BAA8B,EAE9B,MAAM,EACP,MAAM,qBAAqB,CAAC;AAG7B,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAEhE,oEAAoE;AACpE,qBAAa,WAAY,YAAW,yBAAyB,EAAE,8BAA8B;IAC3F,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAoC;IAChE,OAAO,CAAC,QAAQ,CAAC,kBAAkB,CAAgC;gBAEvD,KAAK,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM;IAKhD,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;IAIrD,SAAS,IAAI,OAAO,CAAC,MAAM,CAAC;YAQ3B,QAAQ;IAaT,sBAAsB,CAAC,KAAK,EAAE,kBAAkB,GAAG,OAAO,CAAC,IAAI,CAAC;CAsB9E"}
1
+ {"version":3,"file":"l2_tips_store.d.ts","sourceRoot":"","sources":["../../src/stores/l2_tips_store.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,kBAAkB,EAClB,yBAAyB,EACzB,8BAA8B,EAE9B,MAAM,EACP,MAAM,qBAAqB,CAAC;AAG7B,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAEhE,oEAAoE;AACpE,qBAAa,WAAY,YAAW,yBAAyB,EAAE,8BAA8B;IAC3F,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAoC;IAChE,OAAO,CAAC,QAAQ,CAAC,kBAAkB,CAAgC;gBAEvD,KAAK,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM;IAKhD,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;IAIrD,SAAS,IAAI,OAAO,CAAC,MAAM,CAAC;YAQ3B,QAAQ;IAaT,sBAAsB,CAAC,KAAK,EAAE,kBAAkB,GAAG,OAAO,CAAC,IAAI,CAAC;CAwB9E"}
@@ -41,11 +41,14 @@
41
41
  async handleBlockStreamEvent(event) {
42
42
  switch(event.type){
43
43
  case 'blocks-added':
44
- for (const block of event.blocks){
45
- await this.l2BlockHashesStore.set(block.number, (await block.header.hash()).toString());
44
+ {
45
+ const blocks = event.blocks.map((b)=>b.block);
46
+ for (const block of blocks){
47
+ await this.l2BlockHashesStore.set(block.number, (await block.header.hash()).toString());
48
+ }
49
+ await this.l2TipsStore.set('latest', blocks.at(-1).number);
50
+ break;
46
51
  }
47
- await this.l2TipsStore.set('latest', event.blocks.at(-1).number);
48
- break;
49
52
  case 'chain-pruned':
50
53
  await this.l2TipsStore.set('latest', event.blockNumber);
51
54
  break;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aztec/kv-store",
3
- "version": "0.80.0",
3
+ "version": "0.81.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": "./dest/interfaces/index.js",
@@ -25,10 +25,10 @@
25
25
  "./package.local.json"
26
26
  ],
27
27
  "dependencies": {
28
- "@aztec/ethereum": "0.80.0",
29
- "@aztec/foundation": "0.80.0",
30
- "@aztec/native": "0.80.0",
31
- "@aztec/stdlib": "0.80.0",
28
+ "@aztec/ethereum": "0.81.0",
29
+ "@aztec/foundation": "0.81.0",
30
+ "@aztec/native": "0.81.0",
31
+ "@aztec/stdlib": "0.81.0",
32
32
  "idb": "^8.0.0",
33
33
  "lmdb": "^3.2.0",
34
34
  "msgpackr": "^1.11.2",
@@ -47,12 +47,14 @@ export class L2TipsStore implements L2BlockStreamEventHandler, L2BlockStreamLoca
47
47
 
48
48
  public async handleBlockStreamEvent(event: L2BlockStreamEvent): Promise<void> {
49
49
  switch (event.type) {
50
- case 'blocks-added':
51
- for (const block of event.blocks) {
50
+ case 'blocks-added': {
51
+ const blocks = event.blocks.map(b => b.block);
52
+ for (const block of blocks) {
52
53
  await this.l2BlockHashesStore.set(block.number, (await block.header.hash()).toString());
53
54
  }
54
- await this.l2TipsStore.set('latest', event.blocks.at(-1)!.number);
55
+ await this.l2TipsStore.set('latest', blocks.at(-1)!.number);
55
56
  break;
57
+ }
56
58
  case 'chain-pruned':
57
59
  await this.l2TipsStore.set('latest', event.blockNumber);
58
60
  break;