From 37a506af1201afaa306d1a7fa34446b63c6db0b7 Mon Sep 17 00:00:00 2001 From: Alireza Haghshenas Date: Tue, 10 Oct 2023 11:53:59 -0700 Subject: [PATCH] chore: build succeeds --- cspell.json | 16 +++++++++++++++- .../src/schema/operation.ts | 4 +++- .../taquito-michel-codec/src/micheline-parser.ts | 16 +++++++++++----- packages/taquito-utils/src/taquito-utils.ts | 8 ++++---- 4 files changed, 33 insertions(+), 11 deletions(-) diff --git a/cspell.json b/cspell.json index 1ed410f95f..e83f06432f 100644 --- a/cspell.json +++ b/cspell.json @@ -4,12 +4,16 @@ "Alireza", "Annot", "annots", + "b58cdecode", + "b58cencode", "beaconwallet", "bigmap", "BIGMAPCONTRACT", "bigmaps", "bignumber", "Bjorsell", + "blakejs", + "BLPK", "Boissonneault", "camelcase", "crios", @@ -18,9 +22,11 @@ "ecad", "ecadlabs", "edonet", + "EDPK", "edsk", "Ejara", "entrypoints", + "eztz", "FAILWITH", "flextesa", "florencenet", @@ -37,10 +43,12 @@ "ithacanet", "jakartanet", "Kernaghan", + "Kishino", "kukai", "lambda", "Letourneau", "Ligo", + "mergebuf", "micheline", "Micheline", "michelsonmap", @@ -52,6 +60,7 @@ "nairobinet", "octez", "oxheadalpha", + "Pkhfrom", "precommit", "println", "Protofire", @@ -63,6 +72,9 @@ "sbytes", "SCORU", "smartcontracts", + "sotez", + "SPPK", + "stablelib", "staker", "taquito", "tcli", @@ -76,7 +88,9 @@ "tzip", "Umami", "unopt", - "UNPAIR" + "UNPAIR", + "vals", + "ZARITH" ], "files": [ "**/*.ts", diff --git a/packages/taquito-local-forging/src/schema/operation.ts b/packages/taquito-local-forging/src/schema/operation.ts index fca9c6d7b2..3990ef937c 100644 --- a/packages/taquito-local-forging/src/schema/operation.ts +++ b/packages/taquito-local-forging/src/schema/operation.ts @@ -247,7 +247,9 @@ export const schemaEncoder = ); } - return prev + values.reduce((prevBytes, current) => prevBytes + encoder(current), ''); + return ( + prev + values.reduce((prevBytes, current) => prevBytes + encoder(current as object), '') + ); } else { const encoder = encoders[valueToEncode]; return prev + encoder(value[key]); diff --git a/packages/taquito-michel-codec/src/micheline-parser.ts b/packages/taquito-michel-codec/src/micheline-parser.ts index aba0dc5c31..3e5b0f8c20 100644 --- a/packages/taquito-michel-codec/src/micheline-parser.ts +++ b/packages/taquito-michel-codec/src/micheline-parser.ts @@ -23,7 +23,10 @@ export class MichelineParseError extends TaquitoError { * @param token A token caused the error * @param message An error message */ - constructor(public readonly token: Token | null, public readonly message: string) { + constructor( + public readonly token: Token | null, + public readonly message: string + ) { super(); this.name = 'MichelineParseError'; } @@ -31,14 +34,17 @@ export class MichelineParseError extends TaquitoError { /** * @category Error - * @description Error inidicates a failure when parsing Micheline JSON + * @description Error indicates a failure when parsing Micheline JSON */ export class JSONParseError extends TaquitoError { /** * @param node A node caused the error * @param message An error message */ - constructor(public readonly node: unknown, public readonly message: string) { + constructor( + public readonly node: unknown, + public readonly message: string + ) { super(); this.name = 'JSONParseError'; } @@ -97,7 +103,7 @@ export interface ParserOptions extends ProtocolOptions { * console.log(emitMicheline(storage, {indent:" ", newline: "\n",})); * ``` * - * Encode a Michelson expression for inital storage of a smart contract + * Encode a Michelson expression for initial storage of a smart contract * ``` * const src = `(Pair (Pair { Elt 1 * (Pair (Pair "tz1gjaF81ZRRvdzjobyfVNsAeSC6PScjfQwN" "tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx") @@ -413,7 +419,7 @@ export class Parser { throw new JSONParseError(a, `string expected: ${a}`); } } - ret.annots = p.annots; + ret.annots = p.annots as string[]; } if (p.args !== undefined) { diff --git a/packages/taquito-utils/src/taquito-utils.ts b/packages/taquito-utils/src/taquito-utils.ts index 47062f30ec..fda187d586 100644 --- a/packages/taquito-utils/src/taquito-utils.ts +++ b/packages/taquito-utils/src/taquito-utils.ts @@ -83,7 +83,7 @@ export const b58cdecode = (enc: string, prefixArg: Uint8Array): Uint8Array => * @param value Value to base58 decode */ export function b58decode(payload: string) { - const buf: Buffer = bs58check.decode(payload); + const buf = bs58check.decode(payload); const prefixMap = { [prefix.tz1.toString()]: '0000', @@ -117,7 +117,7 @@ export function b58decode(payload: string) { * @returns string of bytes */ export function b58decodeL2Address(payload: string) { - const buf: Buffer = bs58check.decode(payload); + const buf = bs58check.decode(payload); // tz4 address currently return buf2hex(buf.slice(3, 42)); @@ -289,7 +289,7 @@ export const mic2arr = function me2(s: any): any { * * @param buffer Buffer to convert */ -export const buf2hex = (buffer: Buffer): string => { +export const buf2hex = (buffer: Uint8Array): string => { const byteArray = new Uint8Array(buffer); const hexParts: string[] = []; byteArray.forEach((byte) => { @@ -397,7 +397,7 @@ export function num2PaddedHex(val: number | BigNumber, bitLength = 8): string { const nibbleLength: number = Math.ceil(bitLength / 4); const hex: string = val.toString(16); - // check whether nibble (4 bits) length is higher or lowerthan the current hex string length + // check whether nibble (4 bits) length is higher or lower than the current hex string length let targetLength: number = hex.length >= nibbleLength ? hex.length : nibbleLength; // make sure the hex string target length is even