Skip to content

Commit 6c4f194

Browse files
dong77wangdongBrechtpd
authored
update some package.json files (#2431)
* update package.json files * more * test fixes (#2433) * fixes * fix Co-authored-by: wangdong <[email protected]> Co-authored-by: Brecht Devos <[email protected]>
1 parent b2c3601 commit 6c4f194

File tree

11 files changed

+79894
-45988
lines changed

11 files changed

+79894
-45988
lines changed

packages/hebao_v2/package-lock.json

Lines changed: 14309 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/hebao_v2/test/guardian.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ describe("wallet", () => {
145145
);
146146
});
147147

148-
it.only("add guardian with approval", async () => {
148+
it("add guardian with approval", async () => {
149149
const owner = await account1.getAddress();
150150
const guardian1 = await account2.getAddress();
151151
const guardian2 = await account3.getAddress();

packages/hebao_v2/test/helper/Bitstream.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { BigNumber } from "bignumber.js";
21
import BN from "bn.js";
32
const abi = require("ethereumjs-abi");
43
const assert = require("assert");
@@ -34,11 +33,6 @@ export class Bitstream {
3433
}
3534
}
3635

37-
public addBigNumber(x: BigNumber, numBytes = 32) {
38-
const formattedData = this.padString(x.toString(16), numBytes * 2);
39-
return this.insert(formattedData);
40-
}
41-
4236
public addBN(x: BN, numBytes = 32) {
4337
const formattedData = this.padString(x.toString(16), numBytes * 2);
4438
return this.insert(formattedData);
@@ -51,7 +45,7 @@ export class Bitstream {
5145
const hex = encoded.toString("hex").slice(-(numBytes * 2));
5246
return this.addHex(hex);
5347
} else {
54-
return this.addBigNumber(new BigNumber(x), numBytes);
48+
return this.addBN(new BN(x), numBytes);
5549
}
5650
}
5751

packages/hebao_v2/test/helper/Signature.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ function signEthereum(message: Buffer, privateKey: string) {
6767
const data = new Bitstream();
6868
data.addHex(ethUtil.bufferToHex(signature.r));
6969
data.addHex(ethUtil.bufferToHex(signature.s));
70-
data.addHex(ethUtil.bufferToHex(signature.v));
70+
data.addNumber(signature.v, 1);
7171
return data.getData();
7272
}
7373

@@ -77,7 +77,7 @@ function signEIP712(message: Buffer, privateKey: string) {
7777
const data = new Bitstream();
7878
data.addHex(ethUtil.bufferToHex(signature.r));
7979
data.addHex(ethUtil.bufferToHex(signature.s));
80-
data.addHex(ethUtil.bufferToHex(signature.v));
80+
data.addNumber(signature.v, 1);
8181
return data.getData();
8282
}
8383

packages/hebao_v2/test/read.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ describe("wallet", () => {
3131
// const quotaInfo = (await wallet.wallet())["quota"];
3232
});
3333

34-
describe.only("read methods", () => {
34+
describe("read methods", () => {
3535
it("quota", async () => {
3636
const walletData = await wallet.wallet();
3737
console.log("walletData:", walletData);

packages/loopring_v3.js/globals.d.ts

Lines changed: 60 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,63 @@
1-
declare module "bn.js";
1+
declare module 'bn.js' {
2+
import { Buffer } from 'buffer'
3+
4+
type Endianness = 'le'|'be'
5+
6+
class BN {
7+
constructor(number: number|string|number[]|Buffer, base?: number, endian?: Endianness)
8+
clone(): BN
9+
toString(base?: number, length?: number): string
10+
toNumber(): number
11+
toJSON(): string
12+
toArray(endian?: Endianness, length?: number): number[]
13+
toBuffer(endian?: Endianness, length?: number): Buffer
14+
bitLength(): number
15+
zeroBits(): number
16+
byteLength(): number
17+
isNeg(): boolean
18+
isEven(): boolean
19+
isOdd(): boolean
20+
isZero(): boolean
21+
cmp(b: any): number
22+
lt(b: any): boolean
23+
lte(b: any): boolean
24+
gt(b: any): boolean
25+
gte(b: any): boolean
26+
eq(b: any): boolean
27+
isBN(b: any): boolean
28+
29+
neg(): BN
30+
abs(): BN
31+
add(b: BN): BN
32+
sub(b: BN): BN
33+
mul(b: BN): BN
34+
sqr(): BN
35+
pow(b: BN): BN
36+
div(b: BN): BN
37+
mod(b: BN): BN
38+
divRound(b: BN): BN
39+
40+
or(b: BN): BN
41+
and(b: BN): BN
42+
xor(b: BN): BN
43+
setn(b: number): BN
44+
shln(b: number): BN
45+
shrn(b: number): BN
46+
testn(b: number): boolean
47+
maskn(b: number): BN
48+
bincn(b: number): BN
49+
notn(w: number): BN
50+
51+
gcd(b: BN): BN
52+
egcd(b: BN): { a: BN, b: BN, gcd: BN }
53+
invm(b: BN): BN
54+
55+
iadd(b: BN): BN
56+
isub(b: BN): BN
57+
}
58+
export = BN
59+
}
60+
261
declare module "ethereumjs-abi";
362
declare module "ethereumjs-util";
463
declare module "es6-promisify";

0 commit comments

Comments
 (0)