Skip to content
This repository was archived by the owner on Nov 15, 2024. It is now read-only.

chore: fix some typos in comment #83

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/clmm/utils/tickarrayBitmap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ export class TickArrayBitmapExtension {
const tickArrayOffsetInBitmap = this.tickArrayOffsetInBitmap(nextTickArrayStartIndex, tickSpacing)
if (zeroForOne) {
// tick from upper to lower
// find from highter bits to lower bits
// find from higher bits to lower bits
const offsetBitMap = TickUtils.mergeTickArrayBitmap(tickarrayBitmap).shln(
TICK_ARRAY_BITMAP_SIZE - 1 - tickArrayOffsetInBitmap,
)
Expand All @@ -203,7 +203,7 @@ export class TickArrayBitmapExtension {
}
} else {
// tick from lower to upper
// find from lower bits to highter bits
// find from lower bits to higher bits
const offsetBitMap = TickUtils.mergeTickArrayBitmap(tickarrayBitmap).shrn(tickArrayOffsetInBitmap)

const nextBit = isZero(512, offsetBitMap) ? null : trailingZeros(512, offsetBitMap)
Expand Down
10 changes: 5 additions & 5 deletions src/marshmallow/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export class BNLayout<P extends string = ''> extends Layout<BN, P> {
signed: boolean

constructor(span: number, signed: boolean, property?: P) {
//@ts-expect-error type wrong for super()'s type different from extends, but it desn't matter
//@ts-expect-error type wrong for super()'s type different from extends, but it doesn't matter
super(span, property)
this.blob = blob(span)
this.signed = signed
Expand All @@ -41,7 +41,7 @@ export class BNLayout<P extends string = ''> extends Layout<BN, P> {

/** @override */
encode(src: BN, b: Buffer, offset = 0) {
if (typeof src === 'number') src = new BN(src) // src will pass a number accidently in union
if (typeof src === 'number') src = new BN(src) // src will pass a number accidentally in union
if (this.signed) {
src = src.toTwos(this.span * 8)
}
Expand All @@ -54,7 +54,7 @@ export class WideBits<P extends string = ''> extends Layout<Record<string, boole
_upper: any
// TODO: unknown
constructor(property?: P) {
//@ts-expect-error type wrong for super()'s type different from extends , but it desn't matter
//@ts-expect-error type wrong for super()'s type different from extends , but it doesn't matter
super(8, property)
this._lower = bits(_u32(), false)
this._upper = bits(_u32(), false)
Expand Down Expand Up @@ -113,7 +113,7 @@ export class WrappedLayout<T, U, P extends string = ''> extends Layout<U, P> {
encoder: (src: U) => T

constructor(layout: Layout<T>, decoder: (data: T) => U, encoder: (src: U) => T, property?: P) {
//@ts-expect-error type wrong for super()'s type different from extends , but it desn't matter
//@ts-expect-error type wrong for super()'s type different from extends , but it doesn't matter
super(layout.span, property)
this.layout = layout
this.decoder = decoder
Expand Down Expand Up @@ -147,7 +147,7 @@ export class OptionLayout<T, P> extends Layout<T | null, P> {
discriminator: Layout<number>

constructor(layout: Layout<T>, property?: P) {
//@ts-expect-error type wrong for super()'s type different from extends , but it desn't matter
//@ts-expect-error type wrong for super()'s type different from extends , but it doesn't matter
super(-1, property)
this.layout = layout
this.discriminator = _u8()
Expand Down