@@ -7,7 +7,7 @@ export function getProofSetEntityId(setId: BigInt): Bytes {
77}
88
99export function getRootEntityId ( setId : BigInt , rootId : BigInt ) : Bytes {
10- return Bytes . fromUTF8 ( setId . toString ( ) + "-" + rootId . toString ( ) ) ;
10+ return Bytes . fromUTF8 ( ` ${ setId . toString ( ) } - ${ rootId . toString ( ) } ` ) ;
1111}
1212
1313// Uniform pseudorandom sort key for Root entities. Used by dealbot to draw
@@ -77,7 +77,7 @@ export class UvarintResult {
7777}
7878
7979export function readUvarint ( data : Bytes , offset : BigInt ) : UvarintResult {
80- let offsetU32 = offset . toU32 ( ) ;
80+ const offsetU32 = offset . toU32 ( ) ;
8181
8282 if ( offsetU32 >= u32 ( data . length ) ) {
8383 return new UvarintResult ( false ) ;
@@ -97,7 +97,7 @@ export function readUvarint(data: Bytes, offset: BigInt): UvarintResult {
9797 return new UvarintResult ( false ) ;
9898 }
9999
100- let nextByte = u64 ( data [ offsetU32 + i ] & 0x7f ) ;
100+ const nextByte = u64 ( data [ offsetU32 + i ] & 0x7f ) ;
101101 value = value | ( nextByte << ( i * 7 ) ) ;
102102 }
103103
@@ -122,12 +122,12 @@ export function validateCommPv2(cidData: Bytes): CommPv2ValidationResult {
122122 return new CommPv2ValidationResult ( false ) ;
123123 }
124124
125- let mhLengthResult = readUvarint ( cidData , offset ) ;
125+ const mhLengthResult = readUvarint ( cidData , offset ) ;
126126 if ( ! mhLengthResult . isValid ) {
127127 return new CommPv2ValidationResult ( false ) ;
128128 }
129129
130- let mhLength = mhLengthResult . value ;
130+ const mhLength = mhLengthResult . value ;
131131 offset = mhLengthResult . offset ;
132132
133133 if ( mhLength . lt ( BigInt . fromU32 ( 34 ) ) ) {
@@ -142,19 +142,19 @@ export function validateCommPv2(cidData: Bytes): CommPv2ValidationResult {
142142 return new CommPv2ValidationResult ( false ) ;
143143 }
144144
145- let paddingResult = readUvarint ( cidData , offset ) ;
145+ const paddingResult = readUvarint ( cidData , offset ) ;
146146 if ( ! paddingResult . isValid ) {
147147 return new CommPv2ValidationResult ( false ) ;
148148 }
149149
150- let padding = paddingResult . value ;
150+ const padding = paddingResult . value ;
151151 offset = paddingResult . offset ;
152152
153153 if ( offset . toU32 ( ) >= u32 ( cidData . length ) ) {
154154 return new CommPv2ValidationResult ( false ) ;
155155 }
156156
157- let height = cidData [ offset . toU32 ( ) ] ;
157+ const height = cidData [ offset . toU32 ( ) ] ;
158158 offset = offset . plus ( BigInt . fromU32 ( 1 ) ) ;
159159
160160 return new CommPv2ValidationResult ( true , padding , height , offset ) ;
0 commit comments