Skip to content
This repository has been archived by the owner. It is now read-only.

Removes transition btc->bat code #13039

Merged
merged 2 commits into from Feb 21, 2018
Merged
Changes from 1 commit
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

Prev

Adds new wallet creation for old btc wallets

  • Loading branch information
NejcZdovc authored and bsclifton committed Feb 7, 2018
commit c8d0d7f53a94920e2f356b70d15bbbe074bc22c9
@@ -1501,7 +1501,7 @@ const getStateInfo = (state, parsedData) => {
const info = parsedData.paymentInfo
const then = new Date().getTime() - ledgerUtil.milliseconds.year

if (!parsedData.properties.wallet) {
if (!parsedData.properties || !parsedData.properties.wallet) {
return state
}

@@ -2057,6 +2057,22 @@ const getContributionAmount = (state) => {
}

const onInitRead = (state, parsedData) => {
const isBTC = parsedData &&
parsedData.properties &&
parsedData.properties.wallet &&
parsedData.properties.wallet.keychains

if (isBTC) {

This comment has been minimized.

Copy link
@bsclifton

bsclifton Feb 20, 2018

Member

I think we should add verbose logging here- something like:
Bitcoin wallet detected; backing up to "ledger-state-btc.json" and creating new BAT wallet

const fs = require('fs')
fs.renameSync(pathName(statePath), pathName('ledger-state-btc.json'))
state = ledgerState.resetInfo(state)
clientprep()
client = ledgerClient(null, underscore.extend({roundtrip: roundtrip}, clientOptions), null)
parsedData = client.state
getPaymentInfo(state)
muonWriter(statePath, parsedData)
}

if (Array.isArray(parsedData.transactions)) {
parsedData.transactions.sort((transaction1, transaction2) => {
return transaction1.submissionStamp - transaction2.submissionStamp
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.