@@ -61,32 +61,36 @@ describe('lets make proofs', () => {
61
61
assert . fail ( `Failed to verify proof: ${ err } ` )
62
62
}
63
63
} )
64
- it ( 'should pass for empty trie' , async ( ) => {
65
- const trie = await createVerkleTree ( {
66
- verkleCrypto : verkle ,
67
- db : new MapDB ( ) ,
68
- } )
64
+ it (
65
+ 'should pass for empty trie' ,
66
+ async ( ) => {
67
+ const trie = await createVerkleTree ( {
68
+ verkleCrypto : verkle ,
69
+ db : new MapDB ( ) ,
70
+ } )
69
71
70
- const proof = verkle . createProof ( [
71
- {
72
- // Get commitment from root node
73
- serializedCommitment : verkle . serializeCommitment (
74
- ( await trie . findPath ( new Uint8Array ( 31 ) ) ) . stack ! [ 0 ] [ 0 ] . commitment ,
75
- ) ,
76
- vector : new Array ( 256 ) . fill ( new Uint8Array ( 32 ) ) ,
77
- indices : [ 0 ] ,
78
- } ,
79
- ] )
80
- const res = verkle . verifyProof ( proof , [
81
- {
82
- serializedCommitment : verkle . serializeCommitment (
83
- ( await trie . findPath ( new Uint8Array ( 31 ) ) ) . stack ! [ 0 ] [ 0 ] . commitment ,
84
- ) ,
85
- indexValuePairs : [ { index : 0 , value : new Uint8Array ( 32 ) } ] ,
86
- } ,
87
- ] )
88
- assert . isTrue ( res )
89
- } )
72
+ const proof = verkle . createProof ( [
73
+ {
74
+ // Get commitment from root node
75
+ serializedCommitment : verkle . serializeCommitment (
76
+ ( await trie . findPath ( new Uint8Array ( 31 ) ) ) . stack ! [ 0 ] [ 0 ] . commitment ,
77
+ ) ,
78
+ vector : new Array ( 256 ) . fill ( new Uint8Array ( 32 ) ) ,
79
+ indices : [ 0 ] ,
80
+ } ,
81
+ ] )
82
+ const res = verkle . verifyProof ( proof , [
83
+ {
84
+ serializedCommitment : verkle . serializeCommitment (
85
+ ( await trie . findPath ( new Uint8Array ( 31 ) ) ) . stack ! [ 0 ] [ 0 ] . commitment ,
86
+ ) ,
87
+ indexValuePairs : [ { index : 0 , value : new Uint8Array ( 32 ) } ] ,
88
+ } ,
89
+ ] )
90
+ assert . isTrue ( res )
91
+ } ,
92
+ { timeout : 15000 } ,
93
+ )
90
94
it . skip ( 'should verify proof for single leaf node' , async ( ) => {
91
95
const node = await LeafVerkleNode . create ( randomBytes ( 31 ) , verkle )
92
96
node . setValue ( 0 , setLengthRight ( bigIntToBytes ( 1n ) , 32 ) )
0 commit comments