@aztec/txe 0.76.4 → 0.77.0-testnet-ignition.21
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.
- package/dest/bin/index.js +3 -5
- package/dest/index.d.ts +1 -1
- package/dest/index.d.ts.map +1 -1
- package/dest/index.js +106 -106
- package/dest/node/txe_node.d.ts +19 -6
- package/dest/node/txe_node.d.ts.map +1 -1
- package/dest/node/txe_node.js +303 -334
- package/dest/oracle/txe_oracle.d.ts +25 -16
- package/dest/oracle/txe_oracle.d.ts.map +1 -1
- package/dest/oracle/txe_oracle.js +249 -143
- package/dest/txe_service/txe_service.d.ts +3 -3
- package/dest/txe_service/txe_service.d.ts.map +1 -1
- package/dest/txe_service/txe_service.js +205 -105
- package/dest/util/encoding.d.ts +39 -25
- package/dest/util/encoding.d.ts.map +1 -1
- package/dest/util/encoding.js +45 -11
- package/dest/util/expected_failure_error.js +1 -2
- package/dest/util/txe_database.d.ts +3 -2
- package/dest/util/txe_database.d.ts.map +1 -1
- package/dest/util/txe_database.js +6 -10
- package/dest/util/txe_public_contract_data_source.d.ts +5 -3
- package/dest/util/txe_public_contract_data_source.d.ts.map +1 -1
- package/dest/util/txe_public_contract_data_source.js +25 -13
- package/dest/util/txe_world_state_db.d.ts +6 -8
- package/dest/util/txe_world_state_db.d.ts.map +1 -1
- package/dest/util/txe_world_state_db.js +10 -23
- package/package.json +14 -15
- package/src/index.ts +2 -2
- package/src/node/txe_node.ts +64 -42
- package/src/oracle/txe_oracle.ts +101 -86
- package/src/txe_service/txe_service.ts +25 -28
- package/src/util/encoding.ts +32 -5
- package/src/util/txe_database.ts +3 -2
- package/src/util/txe_public_contract_data_source.ts +8 -9
- package/src/util/txe_world_state_db.ts +9 -26
|
@@ -1,15 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
type AztecAddress,
|
|
4
|
-
type ContractDataSource,
|
|
5
|
-
Fr,
|
|
6
|
-
type PublicDataTreeLeafPreimage,
|
|
7
|
-
PublicDataWrite,
|
|
8
|
-
} from '@aztec/circuits.js';
|
|
9
|
-
import { computePublicDataTreeLeafSlot } from '@aztec/circuits.js/hash';
|
|
1
|
+
import { Fr } from '@aztec/foundation/fields';
|
|
10
2
|
import { WorldStateDB } from '@aztec/simulator/server';
|
|
3
|
+
import { PublicDataWrite } from '@aztec/stdlib/avm';
|
|
4
|
+
import type { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
5
|
+
import type { ContractDataSource } from '@aztec/stdlib/contract';
|
|
6
|
+
import { computePublicDataTreeLeafSlot } from '@aztec/stdlib/hash';
|
|
7
|
+
import type { MerkleTreeWriteOperations } from '@aztec/stdlib/interfaces/server';
|
|
8
|
+
import { MerkleTreeId, type PublicDataTreeLeafPreimage } from '@aztec/stdlib/trees';
|
|
11
9
|
|
|
12
|
-
import {
|
|
10
|
+
import type { TXE } from '../oracle/txe_oracle.js';
|
|
13
11
|
|
|
14
12
|
export class TXEWorldStateDB extends WorldStateDB {
|
|
15
13
|
constructor(private merkleDb: MerkleTreeWriteOperations, dataSource: ContractDataSource, private txe: TXE) {
|
|
@@ -32,24 +30,9 @@ export class TXEWorldStateDB extends WorldStateDB {
|
|
|
32
30
|
return value;
|
|
33
31
|
}
|
|
34
32
|
|
|
35
|
-
override async storageWrite(contract: AztecAddress, slot: Fr, newValue: Fr): Promise<
|
|
33
|
+
override async storageWrite(contract: AztecAddress, slot: Fr, newValue: Fr): Promise<void> {
|
|
36
34
|
await this.txe.addPublicDataWrites([
|
|
37
35
|
new PublicDataWrite(await computePublicDataTreeLeafSlot(contract, slot), newValue),
|
|
38
36
|
]);
|
|
39
|
-
|
|
40
|
-
return newValue.toBigInt();
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
override checkpoint(): Promise<void> {
|
|
44
|
-
return Promise.resolve();
|
|
45
|
-
}
|
|
46
|
-
override rollbackToCheckpoint(): Promise<void> {
|
|
47
|
-
throw new Error('Cannot rollback');
|
|
48
|
-
}
|
|
49
|
-
override commit(): Promise<void> {
|
|
50
|
-
return Promise.resolve();
|
|
51
|
-
}
|
|
52
|
-
override rollbackToCommit(): Promise<void> {
|
|
53
|
-
throw new Error('Cannot rollback');
|
|
54
37
|
}
|
|
55
38
|
}
|