Bring back no-bitwise
This commit is contained in:
parent
4b7a060a4b
commit
9705b98be9
@ -21,6 +21,7 @@ module.exports = {
|
||||
],
|
||||
rules: {
|
||||
curly: ["warn", "multi-line", "consistent"],
|
||||
"no-bitwise": "warn",
|
||||
"no-console": ["warn", { allow: ["error", "info", "warn"] }],
|
||||
"no-param-reassign": "warn",
|
||||
"no-shadow": "warn",
|
||||
|
||||
@ -32,7 +32,9 @@ export interface Erc20Token {
|
||||
readonly fractionalDigits: number;
|
||||
}
|
||||
|
||||
// eslint-disable-next-line no-bitwise
|
||||
const maxAcct = 1 << 23;
|
||||
// eslint-disable-next-line no-bitwise
|
||||
const maxSeq = 1 << 20;
|
||||
|
||||
// this (lossily) encodes the two pieces of info (uint64) needed to sign into
|
||||
|
||||
@ -11,10 +11,13 @@ export function leb128Encode(uint: number): Uint8Array {
|
||||
const out = new Array<number>();
|
||||
let value = uint;
|
||||
do {
|
||||
// eslint-disable-next-line no-bitwise
|
||||
let byte = value & 0b01111111;
|
||||
// eslint-disable-next-line no-bitwise
|
||||
value >>= 7;
|
||||
|
||||
// more bytes to come: set high order bit of byte
|
||||
// eslint-disable-next-line no-bitwise
|
||||
if (value !== 0) byte ^= 0b10000000;
|
||||
|
||||
out.push(byte);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user