Skip to content

Commit

Permalink
Fix margin guard
Browse files Browse the repository at this point in the history
  • Loading branch information
PeterBenc authored and DavidTranDucVL committed Nov 25, 2020
1 parent 5050cf3 commit 55b1d7f
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/transaction/guards.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,12 @@ export const isTxMultiHostNameRelay = (

const isMargin = (test: any) => {
if (typeof test !== 'object') return false
return 'value' in test
&& 0 in test.value
&& Number.isInteger(test.value[0])
&& 1 in test.value
&& Number.isInteger(test.value[1])
const { tag, value } = test
if (!Array.isArray(value)) return false
const [numerator, denominator] = value
return tag === 30
&& Number.isInteger(numerator)
&& Number.isInteger(denominator)
}

const isMetaData = (test: any) => {
Expand Down

0 comments on commit 55b1d7f

Please sign in to comment.