Bring back no-bitwise

This commit is contained in:
Simon Warta 2020-02-19 09:42:20 +01:00
parent 4b7a060a4b
commit 9705b98be9
3 changed files with 6 additions and 0 deletions

View File

@ -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",

View File

@ -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

View File

@ -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);