Skip to content

Commit

Permalink
chore: build succeeds
Browse files Browse the repository at this point in the history
  • Loading branch information
ac10n committed Oct 10, 2023
1 parent 4ff541b commit 37a506a
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 11 deletions.
16 changes: 15 additions & 1 deletion cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,16 @@
"Alireza",
"Annot",
"annots",
"b58cdecode",
"b58cencode",
"beaconwallet",
"bigmap",
"BIGMAPCONTRACT",
"bigmaps",
"bignumber",
"Bjorsell",
"blakejs",
"BLPK",
"Boissonneault",
"camelcase",
"crios",
Expand All @@ -18,9 +22,11 @@
"ecad",
"ecadlabs",
"edonet",
"EDPK",
"edsk",
"Ejara",
"entrypoints",
"eztz",
"FAILWITH",
"flextesa",
"florencenet",
Expand All @@ -37,10 +43,12 @@
"ithacanet",
"jakartanet",
"Kernaghan",
"Kishino",
"kukai",
"lambda",
"Letourneau",
"Ligo",
"mergebuf",
"micheline",
"Micheline",
"michelsonmap",
Expand All @@ -52,6 +60,7 @@
"nairobinet",
"octez",
"oxheadalpha",
"Pkhfrom",
"precommit",
"println",
"Protofire",
Expand All @@ -63,6 +72,9 @@
"sbytes",
"SCORU",
"smartcontracts",
"sotez",
"SPPK",
"stablelib",
"staker",
"taquito",
"tcli",
Expand All @@ -76,7 +88,9 @@
"tzip",
"Umami",
"unopt",
"UNPAIR"
"UNPAIR",
"vals",
"ZARITH"
],
"files": [
"**/*.ts",
Expand Down
4 changes: 3 additions & 1 deletion packages/taquito-local-forging/src/schema/operation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
Expand Down
16 changes: 11 additions & 5 deletions packages/taquito-michel-codec/src/micheline-parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,22 +23,28 @@ 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';
}
}

/**
* @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';
}
Expand Down Expand Up @@ -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")
Expand Down Expand Up @@ -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) {
Expand Down
8 changes: 4 additions & 4 deletions packages/taquito-utils/src/taquito-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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));
Expand Down Expand Up @@ -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) => {
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 37a506a

Please sign in to comment.