@@ -63,7 +63,7 @@ export function handleBatchOutgoing(event: BatchOutgoing): void {
6363 const batchSize = event . params . batchSize ;
6464 const currentBatchID = event . params . batchID ;
6565
66- let batch = new Batch ( currentBatchID . toString ( ) ) ;
66+ const batch = new Batch ( currentBatchID . toString ( ) ) ;
6767
6868 batch . epochFinal = epochFinal ;
6969 batch . batchSize = batchSize ;
@@ -87,8 +87,8 @@ export function handleBatchOutgoing(event: BatchOutgoing): void {
8787
8888 // PROOF
8989 for ( let idx = 0 ; idx < layerZero . length ; idx ++ ) {
90- let proof : ByteArray [ ] = [ ] ;
91- let _proof = new Proof ( currentBatchID . toString ( ) + "," + idx . toString ( ) ) ;
90+ const proof : ByteArray [ ] = [ ] ;
91+ const _proof = new Proof ( currentBatchID . toString ( ) + "," + idx . toString ( ) ) ;
9292 let _idx = idx ;
9393 for ( let i = 0 ; i < layers . length ; i ++ ) {
9494 const pairIdx = idx % 2 === 0 ? idx + 1 : idx - 1 ;
@@ -109,7 +109,7 @@ export function handleBatchOutgoing(event: BatchOutgoing): void {
109109}
110110
111111function Flatten ( a : ByteArray [ ] ) : ByteArray {
112- let out = new ByteArray ( 32 * a . length ) ;
112+ const out = new ByteArray ( 32 * a . length ) ;
113113 for ( let i = 0 ; i < a . length ; i ++ ) out . set ( a [ i ] , i * 32 ) ;
114114 return out ;
115115}
@@ -118,7 +118,7 @@ function getNextLayer(elements: ByteArray[]): ByteArray[] {
118118 return elements . reduce ( ( layer , el , idx , arr ) => {
119119 if ( idx % 2 === 0 ) {
120120 // Hash the current element with its pair element
121- if ( idx == arr . length - 1 ) {
121+ if ( idx === arr . length - 1 ) {
122122 layer . push ( el ) ;
123123 } else {
124124 layer . push ( crypto . keccak256 ( concatAndSortByteArrays ( el , arr [ idx + 1 ] ) ) ) ;
@@ -130,13 +130,13 @@ function getNextLayer(elements: ByteArray[]): ByteArray[] {
130130}
131131
132132function firstSlotReverse ( a : ByteArray ) : ByteArray {
133- let out = new ByteArray ( 32 ) ;
133+ const out = new ByteArray ( 32 ) ;
134134 for ( let i = 0 ; i < 32 ; i ++ ) out [ i ] = a [ 31 - i ] ;
135135 return out ;
136136}
137137
138138function getAddress ( input : ByteArray , offset : i32 ) : ByteArray {
139- let out = new ByteArray ( 20 ) ;
139+ const out = new ByteArray ( 20 ) ;
140140 for ( let i = 0 ; i < 20 ; i ++ ) out [ i ] = input [ i + offset ] ;
141141 return out ;
142142}
0 commit comments