Skip to content

Commit 2939da9

Browse files
committed
lint fix
1 parent 7d9c034 commit 2939da9

File tree

5 files changed

+24
-24
lines changed

5 files changed

+24
-24
lines changed

__tests__/client.test.js

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -189,25 +189,25 @@ describe("BncClient test", async () => {
189189

190190
it("choose network", async () => {
191191
const client = await getClient(false)
192-
client.chooseNetwork('testnet')
192+
client.chooseNetwork("testnet")
193193
const res = client.createAccountWithKeystore("12345678")
194-
expect(res.address.includes('tbnb')).toBeTruthy()
194+
expect(res.address.includes("tbnb")).toBeTruthy()
195195

196-
client.chooseNetwork('mainnet')
196+
client.chooseNetwork("mainnet")
197197
const res1 = client.createAccountWithKeystore("12345678")
198-
expect(res1.address.includes('bnb')).toBeTruthy()
198+
expect(res1.address.includes("bnb")).toBeTruthy()
199199
})
200200

201201
it("get markets works", async () => {
202202
const client = await getClient(false)
203203
const { result: markets, status } = await client.getMarkets(150)
204204
expect(status).toBe(200)
205205
expect(markets.length).toBeGreaterThan(0)
206-
expect(markets[0]).toHaveProperty('base_asset_symbol');
207-
expect(markets[0]).toHaveProperty('quote_asset_symbol');
208-
expect(markets[0]).toHaveProperty('price');
209-
expect(markets[0]).toHaveProperty('tick_size');
210-
expect(markets[0]).toHaveProperty('lot_size');
206+
expect(markets[0]).toHaveProperty("base_asset_symbol")
207+
expect(markets[0]).toHaveProperty("quote_asset_symbol")
208+
expect(markets[0]).toHaveProperty("price")
209+
expect(markets[0]).toHaveProperty("tick_size")
210+
expect(markets[0]).toHaveProperty("lot_size")
211211
})
212212

213213
it("check number when transfer", async () => {
@@ -220,13 +220,13 @@ describe("BncClient test", async () => {
220220
try{
221221
await client.transfer(addr, targetAddress, -1, "BNB", "hello world", sequence)
222222
} catch(err) {
223-
expect(err.message).toBe(`amount should be a positive number`)
223+
expect(err.message).toBe("amount should be a positive number")
224224
}
225225

226226
try{
227227
await client.transfer(addr, targetAddress, Math.pow(2, 63), "BNB", "hello world", sequence)
228228
} catch(err) {
229-
expect(err.message).toBe(`amount should be less than 2^63`)
229+
expect(err.message).toBe("amount should be less than 2^63")
230230
}
231231
})
232232

@@ -238,13 +238,13 @@ describe("BncClient test", async () => {
238238
try{
239239
await client.placeOrder(addr, symbol, 2, -40, 0.0001, 1)
240240
} catch(err) {
241-
expect(err.message).toBe(`price should be a positive number`)
241+
expect(err.message).toBe("price should be a positive number")
242242
}
243243

244244
try{
245245
await client.placeOrder(addr, symbol, 2, Math.pow(2,63), 2, 1)
246246
} catch(err) {
247-
expect(err.message).toBe(`price should be less than 2^63`)
247+
expect(err.message).toBe("price should be less than 2^63")
248248
}
249249
})
250250
})

src/client/index.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ const api = {
1616
}
1717

1818
const NETWORK_PREFIX_MAPPING = {
19-
'testnet': 'tbnb',
20-
'mainnet': 'bnb'
19+
"testnet": "tbnb",
20+
"mainnet": "bnb"
2121
}
2222

2323
/**
@@ -115,8 +115,8 @@ export class BncClient {
115115
* @param {String} network Indicate testnet or mainnet
116116
*/
117117
chooseNetwork(network){
118-
this.addressPrefix = NETWORK_PREFIX_MAPPING[network] || 'tbnb'
119-
this.network = NETWORK_PREFIX_MAPPING[network] ? network : 'testnet'
118+
this.addressPrefix = NETWORK_PREFIX_MAPPING[network] || "tbnb"
119+
this.network = NETWORK_PREFIX_MAPPING[network] ? network : "testnet"
120120
}
121121

122122
/**

src/crypto/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import cryp from "crypto-browserify"
88
import uuid from "uuid"
99
import is from "is_js"
1010
import bip32 from "bip32"
11-
import * as bip39 from 'bip39'
11+
import * as bip39 from "bip39"
1212
import { ec as EC } from "elliptic"
1313
import ecc from "tiny-secp256k1"
1414

src/encoder/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
import vstruct from "varstruct"
66
import { Buffer } from "safe-buffer"
7-
import is from 'is_js'
7+
import is from "is_js"
88

99
import VarInt, { UVarInt } from "./varint"
1010
import typeToTyp3 from "../utils/encoderHelper"

src/ledger/ledger-app.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ const INS_GET_VERSION = 0x00
3232
const INS_PUBLIC_KEY_SECP256K1 = 0x01
3333
const INS_SIGN_SECP256K1 = 0x02
3434
const INS_SHOW_ADDR_SECP256K1 = 0x03
35-
const INS_GET_ADDR_SECP256K1 = 0x04
35+
// const INS_GET_ADDR_SECP256K1 = 0x04
3636

3737
// The general structure of commands and responses is as follows:
3838

@@ -111,10 +111,10 @@ class LedgerApp {
111111
if (hrp == null || hrp.length < 3 || hrp.length > 83) {
112112
throw new Error("Invalid HRP")
113113
}
114-
let buf = Buffer.alloc(1 + hrp.length);
115-
buf.writeUInt8(hrp.length, 0);
116-
buf.write(hrp, 1);
117-
return buf;
114+
let buf = Buffer.alloc(1 + hrp.length)
115+
buf.writeUInt8(hrp.length, 0)
116+
buf.write(hrp, 1)
117+
return buf
118118
}
119119

120120
_serializeHDPath(path) {

0 commit comments

Comments
 (0)