Skip to content

Commit

Permalink
linting
Browse files Browse the repository at this point in the history
  • Loading branch information
mkv-vcm authored and janmazak committed Jan 12, 2022
1 parent 225832d commit cc70043
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 17 deletions.
5 changes: 3 additions & 2 deletions src/parsing/transaction.ts
Expand Up @@ -3,7 +3,7 @@ import { assert } from "console"
import { InvalidData } from "../errors"
import { InvalidDataReason } from "../errors/invalidDataReason"
import type { OutputDestination, ParsedAssetGroup, ParsedCertificate, ParsedInput, ParsedOutput, ParsedRequiredSigner, ParsedSigningRequest, ParsedToken, ParsedTransaction, ParsedWithdrawal} from "../types/internal"
import { RequiredSignerType, KEY_HASH_LENGTH } from "../types/internal"
import { KEY_HASH_LENGTH,RequiredSignerType } from "../types/internal"
import { StakeCredentialType } from "../types/internal"
import { ASSET_NAME_LENGTH_MAX, CertificateType, SCRIPT_DATA_HASH_LENGTH,SpendingDataSourceType, TOKEN_POLICY_LENGTH, TX_HASH_LENGTH } from "../types/internal"
import type {
Expand Down Expand Up @@ -219,10 +219,11 @@ function parseTxDestination(
function addressContainsScripthash(destination: OutputDestination): boolean {
let type: AddressType
switch (destination.type) {
case TxOutputDestinationType.THIRD_PARTY:
case TxOutputDestinationType.THIRD_PARTY: {
const addressBytes: Buffer = hex_to_buf(destination.addressHex)
type = (addressBytes[0] & 0b11110000) >> 4
break
}
case TxOutputDestinationType.DEVICE_OWNED:
type = destination.addressParams.type
break
Expand Down
20 changes: 10 additions & 10 deletions test/integration/__fixtures__/signTxPoolRegistrationRejects.ts
@@ -1,10 +1,10 @@
import type { MultiHostRelayParams, PoolMetadataParams, SingleHostHostnameRelayParams, Transaction } from "../../../src/Ada"
import { CertificateType, DeviceStatusCodes, DeviceStatusError, DeviceStatusMessages, InvalidDataReason, Networks, RelayType } from "../../../src/Ada"
import { PoolKeyType, PoolOwnerType,TransactionSigningMode } from '../../../src/types/public'
import { str_to_path } from "../../../src/utils/address"
import { DeviceStatusError, DeviceStatusCodes, DeviceStatusMessages, CertificateType, InvalidDataReason, Networks, RelayType } from "../../../src/Ada"
import { TransactionSigningMode, PoolKeyType, PoolOwnerType } from '../../../src/types/public'
import type { TestcaseRejectShelley } from "./signTxRejects"
import { inputs, outputs, certificates, defaultPoolRegistration, poolOwnerVariationSet, relayVariationSet } from './signTxPoolRegistration'
import { DontRunOnLedger } from '../../test_utils'
import { certificates, defaultPoolRegistration, inputs, outputs, poolOwnerVariationSet, relayVariationSet } from './signTxPoolRegistration'
import type { TestcaseRejectShelley } from "./signTxRejects"

const txBase: Transaction = {
network: Networks.Mainnet,
Expand Down Expand Up @@ -155,7 +155,7 @@ export const invalidPoolMetadataTestcases: TestcaseRejectShelley[] = [
metadataHashHex: "6bf124f217d0e5a0a8adb1dbd8540e1334280d49ab861127868339f43b3948",
},
},
}
},
],
},
signingMode: TransactionSigningMode.POOL_REGISTRATION_AS_OWNER,
Expand All @@ -176,7 +176,7 @@ export const invalidPoolMetadataTestcases: TestcaseRejectShelley[] = [
metadataHashHex: "cdb714fd722c24aeb10c93dbb0ff03bd4783441cd5ba2a8b6f373390520535bb",
} as PoolMetadataParams,
},
}
},
],
},
signingMode: TransactionSigningMode.POOL_REGISTRATION_AS_OWNER,
Expand All @@ -199,7 +199,7 @@ export const invalidPoolMetadataTestcases: TestcaseRejectShelley[] = [
metadataHashHex: "6bf124f217d0e5a0a8adb1dbd8540e1334280d49ab861127868339f43b3948",
},
},
}
},
],
},
signingMode: TransactionSigningMode.POOL_REGISTRATION_AS_OWNER,
Expand All @@ -220,7 +220,7 @@ export const invalidPoolMetadataTestcases: TestcaseRejectShelley[] = [
metadataUrl: "https://www.vacuumlabs.com/sampleUrl.json",
} as PoolMetadataParams,
},
}
},
],
},
signingMode: TransactionSigningMode.POOL_REGISTRATION_AS_OWNER,
Expand Down Expand Up @@ -250,7 +250,7 @@ export const invalidRelayTestcases: TestcaseRejectShelley[] = [
},
],
},
}
},
],
},
signingMode: TransactionSigningMode.POOL_REGISTRATION_AS_OWNER,
Expand All @@ -276,7 +276,7 @@ export const invalidRelayTestcases: TestcaseRejectShelley[] = [
},
],
},
}
},
],
},
signingMode: TransactionSigningMode.POOL_REGISTRATION_AS_OWNER,
Expand Down
2 changes: 1 addition & 1 deletion test/integration/signTx.test.ts
@@ -1,4 +1,4 @@
import { describeRejects, describePositiveTest, } from "../test_utils"
import { describePositiveTest,describeRejects } from "../test_utils"
import {
testsAllegra,
testsByron,
Expand Down
6 changes: 3 additions & 3 deletions test/integration/signTxPoolRegistration.test.ts
@@ -1,18 +1,18 @@
import chai from "chai"
import chaiAsPromised from "chai-as-promised"

import { describeRejects, describePositiveTest } from "../test_utils"
import { describePositiveTest,describeRejects } from "../test_utils"
import {
poolRegistrationOperatorTestcases,
poolRegistrationOwnerTestcases,
} from "./__fixtures__/signTxPoolRegistration"
import {
poolRegistrationOwnerRejectTestcases,
invalidCertificates,
invalidPoolMetadataTestcases,
invalidRelayTestcases,
stakePoolRegistrationPoolIdRejectTestcases,
poolRegistrationOwnerRejectTestcases,
stakePoolRegistrationOwnerRejectTestcases,
stakePoolRegistrationPoolIdRejectTestcases,
} from "./__fixtures__/signTxPoolRegistrationRejects"
chai.use(chaiAsPromised)

Expand Down
2 changes: 1 addition & 1 deletion test/test_utils.ts
Expand Up @@ -7,8 +7,8 @@ import type { FixlenHexString} from "types/internal"

import { Ada, utils } from "../src/Ada"
import { InvalidDataReason } from "../src/errors/index"
import type { TxAuxiliaryDataSupplement,Witness } from "../src/types/public"
import * as parseModule from "../src/utils/parse"
import type { Witness, TxAuxiliaryDataSupplement } from "../src/types/public"

export async function getTransport() {
return await TransportNodeHid.create(1000)
Expand Down

0 comments on commit cc70043

Please sign in to comment.