mirror of
https://github.com/Xahau/xahau.js.git
synced 2025-12-06 17:27:59 +00:00
lint
This commit is contained in:
@@ -16,8 +16,6 @@ import { HookParameter } from '../models/common'
|
||||
* @description
|
||||
* Transaction types
|
||||
*/
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment -- Required
|
||||
export const tts = TRANSACTION_TYPE_MAP
|
||||
|
||||
/**
|
||||
* @typedef TTS
|
||||
@@ -35,9 +33,6 @@ export type TTS = typeof tts
|
||||
export function calculateHookOn(arr: Array<keyof TTS>): string {
|
||||
let hash = '0x3e3ff5bf'
|
||||
arr.forEach((nth) => {
|
||||
if (!TRANSACTION_TYPE_MAP) {
|
||||
throw new XrplError(`TRANSACTION_TYPE_MAP malformed or undefined`)
|
||||
}
|
||||
if (typeof nth !== 'string') {
|
||||
throw new XrplError(`HookOn transaction type must be string`)
|
||||
}
|
||||
@@ -46,8 +41,10 @@ export function calculateHookOn(arr: Array<keyof TTS>): string {
|
||||
`invalid transaction type '${String(nth)}' in HookOn array`,
|
||||
)
|
||||
}
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment -- Required
|
||||
const tts: Record<string, number> = TRANSACTION_TYPE_MAP
|
||||
let value = BigInt(hash)
|
||||
// eslint-disable-next-line no-bitwise, @typescript-eslint/no-unsafe-member-access -- Required
|
||||
// eslint-disable-next-line no-bitwise -- Required
|
||||
value ^= BigInt(1) << BigInt(tts[nth])
|
||||
// eslint-disable-next-line @typescript-eslint/no-magic-numbers -- Required
|
||||
hash = `0x${value.toString(16)}`
|
||||
|
||||
Reference in New Issue
Block a user