-
Notifications
You must be signed in to change notification settings - Fork 234
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into ad/doc/bb/docker_interactive.sh
- Loading branch information
Showing
44 changed files
with
2,729 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
yarn-project/archiver/src/archiver/kv_archiver_store/contract_class_store.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { Fr } from '@aztec/foundation/fields'; | ||
import { AztecKVStore, AztecMap } from '@aztec/kv-store'; | ||
import { ContractClassWithId, SerializableContractClass } from '@aztec/types/contracts'; | ||
|
||
/** | ||
* LMDB implementation of the ArchiverDataStore interface. | ||
*/ | ||
export class ContractClassStore { | ||
#contractClasses: AztecMap<string, Buffer>; | ||
|
||
constructor(db: AztecKVStore) { | ||
this.#contractClasses = db.createMap('archiver_contract_classes'); | ||
} | ||
|
||
addContractClass(contractClass: ContractClassWithId): Promise<boolean> { | ||
return this.#contractClasses.set( | ||
contractClass.id.toString(), | ||
new SerializableContractClass(contractClass).toBuffer(), | ||
); | ||
} | ||
|
||
getContractClass(id: Fr): ContractClassWithId | undefined { | ||
const contractClass = this.#contractClasses.get(id.toString()); | ||
return contractClass && SerializableContractClass.fromBuffer(contractClass).withId(id); | ||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
yarn-project/archiver/src/archiver/kv_archiver_store/contract_instance_store.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { AztecAddress } from '@aztec/circuits.js'; | ||
import { AztecKVStore, AztecMap } from '@aztec/kv-store'; | ||
import { ContractInstanceWithAddress, SerializableContractInstance } from '@aztec/types/contracts'; | ||
|
||
/** | ||
* LMDB implementation of the ArchiverDataStore interface. | ||
*/ | ||
export class ContractInstanceStore { | ||
#contractInstances: AztecMap<string, Buffer>; | ||
|
||
constructor(db: AztecKVStore) { | ||
this.#contractInstances = db.createMap('archiver_contract_instances'); | ||
} | ||
|
||
addContractInstance(contractInstance: ContractInstanceWithAddress): Promise<boolean> { | ||
return this.#contractInstances.set( | ||
contractInstance.address.toString(), | ||
new SerializableContractInstance(contractInstance).toBuffer(), | ||
); | ||
} | ||
|
||
getContractInstance(address: AztecAddress): ContractInstanceWithAddress | undefined { | ||
const contractInstance = this.#contractInstances.get(address.toString()); | ||
return contractInstance && SerializableContractInstance.fromBuffer(contractInstance).withAddress(address); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,6 +23,9 @@ | |
}, | ||
{ | ||
"path": "../l1-artifacts" | ||
}, | ||
{ | ||
"path": "../types" | ||
} | ||
], | ||
"include": ["src"] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.