@@ -17,11 +17,11 @@ import (
1717)
1818
1919var (
20- leaf1Hash = new ( felt.Felt ). SetUint64 (201 )
21- leaf2Hash = new ( felt.Felt ). SetUint64 (202 )
22- rootHash = new ( felt.Felt ). SetUint64 (100 )
23- level1Hash1 = new ( felt.Felt ). SetUint64 (301 )
24- level1Hash2 = new ( felt.Felt ). SetUint64 (302 )
20+ leaf1Hash = felt.NewFromUint64 [felt. Felt ] (201 )
21+ leaf2Hash = felt.NewFromUint64 [felt. Felt ] (202 )
22+ rootHash = felt.NewFromUint64 [felt. Felt ] (100 )
23+ level1Hash1 = felt.NewFromUint64 [felt. Felt ] (301 )
24+ level1Hash2 = felt.NewFromUint64 [felt. Felt ] (302 )
2525
2626 leaf1Path = trieutils .NewBitArray (1 , 0x00 )
2727 leaf2Path = trieutils .NewBitArray (1 , 0x01 )
@@ -170,12 +170,12 @@ func TestDatabase(t *testing.T) {
170170 memDB := memory .New ()
171171 database := New (memDB , nil )
172172
173- contractHash := * new ( felt.Felt ). SetUint64 (210 )
173+ contractHash := felt.FromUint64 [felt. Felt ] (210 )
174174 contractOwner := felt.FromUint64 [felt.Address ](123 )
175175 contractPath := trieutils .NewBitArray (1 , 0x01 )
176176 contractNode := trienode .NewLeaf (contractHash , []byte {4 , 5 , 6 })
177177
178- storageHash := * new ( felt.Felt ). SetUint64 (220 )
178+ storageHash := felt.FromUint64 [felt. Felt ] (220 )
179179 storagePath := trieutils .NewBitArray (1 , 0x02 )
180180 storageNode := trienode .NewLeaf (storageHash , []byte {7 , 8 , 9 })
181181
@@ -222,7 +222,7 @@ func TestDatabase(t *testing.T) {
222222 memDB := memory .New ()
223223 database := New (memDB , nil )
224224
225- edgeHash := * new ( felt.Felt ). SetUint64 (201 )
225+ edgeHash := felt.FromUint64 [felt. Felt ] (201 )
226226 edgePath := trieutils .NewBitArray (1 , 0x01 )
227227 edgeNode := trienode .NewNonLeaf (edgeHash , createEdgeNodeBlob (leaf1Hash ))
228228
@@ -257,8 +257,8 @@ func TestDatabase(t *testing.T) {
257257 }, numTries )
258258
259259 for i := range numTries {
260- leafHash := new ( felt.Felt ). SetUint64 (uint64 (i * 100 + 50 ))
261- rootHash := new ( felt.Felt ). SetUint64 (uint64 (i * 100 ))
260+ leafHash := felt.NewFromUint64 [felt. Felt ] (uint64 (i * 100 + 50 ))
261+ rootHash := felt.NewFromUint64 [felt. Felt ] (uint64 (i * 100 ))
262262
263263 leafPath := trieutils .NewBitArray (1 , 0x00 )
264264 leafNode := trienode .NewLeaf (* leafHash , []byte {byte (i ), byte (i + 1 ), byte (i + 2 )})
@@ -274,13 +274,13 @@ func TestDatabase(t *testing.T) {
274274 contractRoot felt.Felt
275275 }{
276276 root : * rootHash ,
277- parent : * new ( felt.Felt ). SetUint64 (uint64 (i * 100 - 1 )),
277+ parent : felt.FromUint64 [felt. Felt ] (uint64 (i * 100 - 1 )),
278278 classNodes : map [trieutils.Path ]trienode.TrieNode {
279279 rootPath : rootNode ,
280280 leafPath : leafNode ,
281281 },
282282 classRoot : * rootHash ,
283- contractRoot : * new ( felt.Felt ). SetUint64 (uint64 (3000 + i )),
283+ contractRoot : felt.FromUint64 [felt. Felt ] (uint64 (3000 + i )),
284284 }
285285
286286 err := database .Update (& tries [i ].root , & tries [i ].parent , uint64 (i ), createMergeNodeSet (tries [i ].classNodes ), createContractMergeNodeSet (nil ))
@@ -312,7 +312,7 @@ func TestDatabase(t *testing.T) {
312312 err := database .Update (& felt .Zero , & felt .Zero , 42 , createMergeNodeSet (basicClassNodes ), createContractMergeNodeSet (nil ))
313313 require .NoError (t , err )
314314
315- newRootHash := * new ( felt.Felt ). SetUint64 (101 )
315+ newRootHash := felt.FromUint64 [felt. Felt ] (101 )
316316 newRootNode := trienode .NewNonLeaf (newRootHash , createBinaryNodeBlob (& felt .Zero , leaf2Hash ))
317317
318318 updatedNodes := map [trieutils.Path ]trienode.TrieNode {
@@ -345,7 +345,7 @@ func TestDatabase(t *testing.T) {
345345 memDB := memory .New ()
346346 database := New (memDB , nil )
347347
348- stateCommitment := new ( felt.Felt ). SetUint64 (1000 )
348+ stateCommitment := felt.NewFromUint64 [felt. Felt ] (1000 )
349349 classRootBlob := createBinaryNodeBlob (leaf1Hash , leaf2Hash )
350350 contractRootBlob := createBinaryNodeBlob (leaf1Hash , leaf2Hash )
351351 classRootHash := crypto .Poseidon (leaf1Hash , leaf2Hash )
@@ -393,9 +393,9 @@ func TestDatabase(t *testing.T) {
393393 memDB := memory .New ()
394394 database := New (memDB , nil )
395395
396- stateCommitment := new ( felt.Felt ). SetUint64 (1000 )
397- classRootHash := new ( felt.Felt ). SetUint64 (2000 )
398- contractRootHash := new ( felt.Felt ). SetUint64 (3000 )
396+ stateCommitment := felt.NewFromUint64 [felt. Felt ] (1000 )
397+ classRootHash := felt.NewFromUint64 [felt. Felt ] (2000 )
398+ contractRootHash := felt.NewFromUint64 [felt. Felt ] (3000 )
399399
400400 val := append (classRootHash .Marshal (), contractRootHash .Marshal ()... )
401401 err := memDB .Put (db .StateHashToTrieRootsKey (stateCommitment ), val )
0 commit comments