-
Notifications
You must be signed in to change notification settings - Fork 240
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/lde/serialize_inf' into lde/seri…
…alize_inf
- Loading branch information
Showing
43 changed files
with
381 additions
and
136 deletions.
There are no files selected for viewing
2 changes: 2 additions & 0 deletions
2
docs/docs/aztec/concepts/smart_contracts/functions/context.md
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
25 changes: 23 additions & 2 deletions
25
...functions/public_private_unconstrained.md → ...tracts/functions/function_types_macros.md
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
2 changes: 2 additions & 0 deletions
2
docs/docs/aztec/concepts/smart_contracts/functions/inner_workings.md
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
2 changes: 2 additions & 0 deletions
2
docs/docs/aztec/concepts/smart_contracts/functions/visibility.md
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
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
22 changes: 22 additions & 0 deletions
22
yarn-project/archiver/src/archiver/kv_archiver_store/contract_artifacts_store.test.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,22 @@ | ||
import { AztecAddress } from '@aztec/circuits.js'; | ||
import { openTmpStore } from '@aztec/kv-store/utils'; | ||
import { BenchmarkingContractArtifact } from '@aztec/noir-contracts.js/Benchmarking'; | ||
|
||
import { beforeEach } from '@jest/globals'; | ||
|
||
import { KVArchiverDataStore } from './kv_archiver_store.js'; | ||
|
||
describe('Contract Artifact Store', () => { | ||
let archiverStore: KVArchiverDataStore; | ||
|
||
beforeEach(() => { | ||
archiverStore = new KVArchiverDataStore(openTmpStore()); | ||
}); | ||
|
||
it('Should add and return contract artifacts', async () => { | ||
const artifact = BenchmarkingContractArtifact; | ||
const address = AztecAddress.random(); | ||
await archiverStore.addContractArtifact(address, artifact); | ||
await expect(archiverStore.getContractArtifact(address)).resolves.toEqual(artifact); | ||
}); | ||
}); |
22 changes: 22 additions & 0 deletions
22
yarn-project/archiver/src/archiver/kv_archiver_store/contract_artifacts_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,22 @@ | ||
import { type AztecAddress } from '@aztec/circuits.js'; | ||
import { type ContractArtifact } from '@aztec/foundation/abi'; | ||
import { type AztecKVStore, type AztecMap } from '@aztec/kv-store'; | ||
import { contractArtifactFromBuffer, contractArtifactToBuffer } from '@aztec/types/abi'; | ||
|
||
export class ContractArtifactsStore { | ||
#contractArtifacts: AztecMap<string, Buffer>; | ||
|
||
constructor(db: AztecKVStore) { | ||
this.#contractArtifacts = db.openMap('archiver_contract_artifacts'); | ||
} | ||
|
||
addContractArtifact(address: AztecAddress, contractArtifact: ContractArtifact): Promise<void> { | ||
return this.#contractArtifacts.set(address.toString(), contractArtifactToBuffer(contractArtifact)); | ||
} | ||
|
||
getContractArtifact(address: AztecAddress): ContractArtifact | undefined { | ||
const contractArtifact = this.#contractArtifacts.get(address.toString()); | ||
// TODO(@spalladino): AztecMap lies and returns Uint8Arrays instead of Buffers, hence the extra Buffer.from. | ||
return contractArtifact && contractArtifactFromBuffer(Buffer.from(contractArtifact)); | ||
} | ||
} |
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 |
---|---|---|
|
@@ -29,6 +29,9 @@ | |
}, | ||
{ | ||
"path": "../types" | ||
}, | ||
{ | ||
"path": "../noir-contracts.js" | ||
} | ||
], | ||
"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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,22 @@ | ||
export { CompleteAddress, GrumpkinPrivateKey, type PartialAddress, type PublicKey } from '@aztec/circuits.js'; | ||
export * from './auth_witness.js'; | ||
export * from './aztec_node/rpc/index.js'; | ||
export * from './body.js'; | ||
export * from './function_call.js'; | ||
export * from './notes/index.js'; | ||
export * from './messaging/index.js'; | ||
export * from './interfaces/index.js'; | ||
export * from './l2_block.js'; | ||
export * from './body.js'; | ||
export * from './l2_block_downloader/index.js'; | ||
export * from './l2_block_source.js'; | ||
export * from './public_data_witness.js'; | ||
export * from './tx_effect.js'; | ||
export * from './logs/index.js'; | ||
export * from './merkle_tree_id.js'; | ||
export * from './messaging/index.js'; | ||
export * from './mocks.js'; | ||
export * from './notes/index.js'; | ||
export * from './packed_values.js'; | ||
export * from './public_data_witness.js'; | ||
export * from './public_data_write.js'; | ||
export * from './simulation_error.js'; | ||
export * from './sibling_path/index.js'; | ||
export * from './simulation_error.js'; | ||
export * from './tx/index.js'; | ||
export * from './tx_effect.js'; | ||
export * from './tx_execution_request.js'; | ||
export * from './packed_values.js'; | ||
export * from './interfaces/index.js'; | ||
export * from './auth_witness.js'; | ||
export * from './aztec_node/rpc/index.js'; | ||
export { CompleteAddress, type PublicKey, type PartialAddress, GrumpkinPrivateKey } from '@aztec/circuits.js'; |
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.