Skip to content

Commit

Permalink
fixup! Disable Piratechain
Browse files Browse the repository at this point in the history
  • Loading branch information
peachbits committed Sep 11, 2023
1 parent 444d2f2 commit cc5cfa9
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 11 deletions.
7 changes: 4 additions & 3 deletions src/piratechain/PiratechainEngine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -434,15 +434,16 @@ export async function makeCurrencyEngine(
opts: EdgeCurrencyEngineOptions
): Promise<EdgeCurrencyEngine> {
const safeWalletInfo = asSafePiratechainWalletInfo(walletInfo)
const { makeSynchronizer } =
env.nativeIo['edge-currency-accountbased'].piratechain
// const { makeSynchronizer } =
// env.nativeIo['edge-currency-accountbased'].piratechain ?? {}

const engine = new PiratechainEngine(
env,
tools,
safeWalletInfo,
opts,
makeSynchronizer
// makeSynchronizer
() => {}
)

// Do any async initialization necessary for the engine
Expand Down
25 changes: 17 additions & 8 deletions src/piratechain/PiratechainTools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import { encodeUriCommon, parseUriCommon } from '../common/uriHelpers'
import { getLegacyDenomination } from '../common/utils'
import {
asArrrPublicKey,
asPiratechainPrivateKeys,
// asPiratechainPrivateKeys,
PiratechainNetworkInfo
// UnifiedViewingKey
Expand Down Expand Up @@ -136,14 +137,22 @@ export class PiratechainTools implements EdgeCurrencyTools {
}

async derivePublicKey(walletInfo: EdgeWalletInfo): Promise<Object> {
return { publicKey: 'derivePublicKey is disabled' }
// const { pluginId } = this.currencyInfo
// const piratechainPrivateKeys = asPiratechainPrivateKeys(pluginId)(
// walletInfo.keys
// )
// if (walletInfo.type !== this.currencyInfo.walletType) {
// throw new Error('InvalidWalletType')
// }
const { pluginId } = this.currencyInfo
const piratechainPrivateKeys = asPiratechainPrivateKeys(pluginId)(
walletInfo.keys
)
if (walletInfo.type !== this.currencyInfo.walletType) {
throw new Error('InvalidWalletType')
}

return {
birthdayHeight: piratechainPrivateKeys.birthdayHeight,
publicKey: 'derivePublicKey is disabled',
unifiedViewingKeys: {
extfvk: '',
extpub: ''
}
}

// const mnemonic = piratechainPrivateKeys.mnemonic
// if (typeof mnemonic !== 'string') {
Expand Down

0 comments on commit cc5cfa9

Please sign in to comment.