@@ -18,104 +18,3 @@ pub(crate) unconstrained fn get_resolved_txs(requests: EphemeralArray<Field>) ->
1818
1919#[oracle(aztec_utl_getResolvedTxs)]
2020unconstrained fn get_resolved_txs_oracle (requests : EphemeralArray <Field >) -> EphemeralArray <Option <ResolvedTx >> {}
21-
22- mod test {
23- use crate::oracle::tx_resolution::ResolvedTx ;
24- use crate::protocol::traits::Deserialize ;
25-
26- #[test]
27- unconstrained fn resolved_tx_serialization_matches_typescript () {
28- // Setup test data
29- let tx_hash = 123 ;
30- let unique_note_hashes = BoundedVec ::from_array ([4 , 5 ]);
31- let first_nullifier = 6 ;
32- let block_number : u32 = 7 ;
33- let block_hash = 8 ;
34-
35- // Create a ResolvedTx instance
36- let resolved_tx = ResolvedTx {
37- tx_hash ,
38- unique_note_hashes_in_tx : unique_note_hashes ,
39- first_nullifier_in_tx : first_nullifier ,
40- block_number ,
41- block_hash ,
42- };
43-
44- // Expected output generated from TypeScript's `ResolvedTx.toFields()`
45- let serialized_resolved_tx_from_typescript = [
46- 0x000000000000000000000000000000000000000000000000000000000000007b ,
47- 0x0000000000000000000000000000000000000000000000000000000000000004 ,
48- 0x0000000000000000000000000000000000000000000000000000000000000005 ,
49- 0x0000000000000000000000000000000000000000000000000000000000000000 ,
50- 0x0000000000000000000000000000000000000000000000000000000000000000 ,
51- 0x0000000000000000000000000000000000000000000000000000000000000000 ,
52- 0x0000000000000000000000000000000000000000000000000000000000000000 ,
53- 0x0000000000000000000000000000000000000000000000000000000000000000 ,
54- 0x0000000000000000000000000000000000000000000000000000000000000000 ,
55- 0x0000000000000000000000000000000000000000000000000000000000000000 ,
56- 0x0000000000000000000000000000000000000000000000000000000000000000 ,
57- 0x0000000000000000000000000000000000000000000000000000000000000000 ,
58- 0x0000000000000000000000000000000000000000000000000000000000000000 ,
59- 0x0000000000000000000000000000000000000000000000000000000000000000 ,
60- 0x0000000000000000000000000000000000000000000000000000000000000000 ,
61- 0x0000000000000000000000000000000000000000000000000000000000000000 ,
62- 0x0000000000000000000000000000000000000000000000000000000000000000 ,
63- 0x0000000000000000000000000000000000000000000000000000000000000000 ,
64- 0x0000000000000000000000000000000000000000000000000000000000000000 ,
65- 0x0000000000000000000000000000000000000000000000000000000000000000 ,
66- 0x0000000000000000000000000000000000000000000000000000000000000000 ,
67- 0x0000000000000000000000000000000000000000000000000000000000000000 ,
68- 0x0000000000000000000000000000000000000000000000000000000000000000 ,
69- 0x0000000000000000000000000000000000000000000000000000000000000000 ,
70- 0x0000000000000000000000000000000000000000000000000000000000000000 ,
71- 0x0000000000000000000000000000000000000000000000000000000000000000 ,
72- 0x0000000000000000000000000000000000000000000000000000000000000000 ,
73- 0x0000000000000000000000000000000000000000000000000000000000000000 ,
74- 0x0000000000000000000000000000000000000000000000000000000000000000 ,
75- 0x0000000000000000000000000000000000000000000000000000000000000000 ,
76- 0x0000000000000000000000000000000000000000000000000000000000000000 ,
77- 0x0000000000000000000000000000000000000000000000000000000000000000 ,
78- 0x0000000000000000000000000000000000000000000000000000000000000000 ,
79- 0x0000000000000000000000000000000000000000000000000000000000000000 ,
80- 0x0000000000000000000000000000000000000000000000000000000000000000 ,
81- 0x0000000000000000000000000000000000000000000000000000000000000000 ,
82- 0x0000000000000000000000000000000000000000000000000000000000000000 ,
83- 0x0000000000000000000000000000000000000000000000000000000000000000 ,
84- 0x0000000000000000000000000000000000000000000000000000000000000000 ,
85- 0x0000000000000000000000000000000000000000000000000000000000000000 ,
86- 0x0000000000000000000000000000000000000000000000000000000000000000 ,
87- 0x0000000000000000000000000000000000000000000000000000000000000000 ,
88- 0x0000000000000000000000000000000000000000000000000000000000000000 ,
89- 0x0000000000000000000000000000000000000000000000000000000000000000 ,
90- 0x0000000000000000000000000000000000000000000000000000000000000000 ,
91- 0x0000000000000000000000000000000000000000000000000000000000000000 ,
92- 0x0000000000000000000000000000000000000000000000000000000000000000 ,
93- 0x0000000000000000000000000000000000000000000000000000000000000000 ,
94- 0x0000000000000000000000000000000000000000000000000000000000000000 ,
95- 0x0000000000000000000000000000000000000000000000000000000000000000 ,
96- 0x0000000000000000000000000000000000000000000000000000000000000000 ,
97- 0x0000000000000000000000000000000000000000000000000000000000000000 ,
98- 0x0000000000000000000000000000000000000000000000000000000000000000 ,
99- 0x0000000000000000000000000000000000000000000000000000000000000000 ,
100- 0x0000000000000000000000000000000000000000000000000000000000000000 ,
101- 0x0000000000000000000000000000000000000000000000000000000000000000 ,
102- 0x0000000000000000000000000000000000000000000000000000000000000000 ,
103- 0x0000000000000000000000000000000000000000000000000000000000000000 ,
104- 0x0000000000000000000000000000000000000000000000000000000000000000 ,
105- 0x0000000000000000000000000000000000000000000000000000000000000000 ,
106- 0x0000000000000000000000000000000000000000000000000000000000000000 ,
107- 0x0000000000000000000000000000000000000000000000000000000000000000 ,
108- 0x0000000000000000000000000000000000000000000000000000000000000000 ,
109- 0x0000000000000000000000000000000000000000000000000000000000000000 ,
110- 0x0000000000000000000000000000000000000000000000000000000000000000 ,
111- 0x0000000000000000000000000000000000000000000000000000000000000002 ,
112- 0x0000000000000000000000000000000000000000000000000000000000000006 ,
113- 0x0000000000000000000000000000000000000000000000000000000000000007 ,
114- 0x0000000000000000000000000000000000000000000000000000000000000008 ,
115- ];
116-
117- let deserialized = ResolvedTx ::deserialize (serialized_resolved_tx_from_typescript );
118-
119- assert_eq (deserialized , resolved_tx );
120- }
121- }
0 commit comments