Skip to content

Commit

Permalink
rm unused imports, etc
Browse files Browse the repository at this point in the history
  • Loading branch information
yusefnapora committed Feb 1, 2017
1 parent 4a5cd5c commit 98cfe7d
Show file tree
Hide file tree
Showing 8 changed files with 5 additions and 12 deletions.
1 change: 0 additions & 1 deletion src/model/query_result.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ export type QueryResult = QueryResultValue | Error
export type QueryResultValue = SimpleQueryResultValue | CompoundQueryResultValue
export type SimpleQueryResultValue = number | string | Statement | StatementBody


function unpackQueryResultProtobuf (msg: QueryResultMsg): QueryResult {
if (msg.error != null) {
const errorMsg = msg.error.error || 'Unknown error'
Expand Down
1 change: 0 additions & 1 deletion src/model/statement.js
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,6 @@ class EnvelopeStatementBody extends StatementBody {
}
}


// Expanded statement bodies include the data that a SimpleStatementBody's `object` hash links to
class ExpandedSimpleStatementBody extends SimpleStatementBody {
object: Object
Expand Down
4 changes: 2 additions & 2 deletions src/peer/merge.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const pullThroughPromise = require('pull-promise/through')
const pushable = require('pull-pushable')
const window = require('pull-window')
const pb = require('../protobuf')
const { statementsFromQueryResult, objectIdsFromStatement, protoStreamEncode, protoStreamDecode } = require('./util')
const { protoStreamEncode, protoStreamDecode } = require('./util')
const { flatMap, promiseHash, b58MultihashForBuffer } = require('../common/util')
const { verifyStatementWithKeyCache } = require('../metadata/signatures')

Expand All @@ -16,7 +16,7 @@ import type { MediachainNode } from './node'
import type { Datastore } from './datastore'
import type { P2PSigningPublicKey } from './identity'
import type { PullStreamSource, PullStreamThrough } from './util'
import type { QueryResultMsg, QueryResultValueMsg, StreamErrorMsg, StatementMsg, DataRequestMsg, DataObjectMsg } from '../protobuf/types'
import type { StreamErrorMsg, DataRequestMsg, DataObjectMsg } from '../protobuf/types'
import type { Connection } from 'interface-connection'
import type { QueryResult } from '../model/query_result'

Expand Down
2 changes: 1 addition & 1 deletion src/peer/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ function expandStatement (stmt: Statement, dataObjects: Array<DataObjectMsg>): S
val = decode(obj.data)
} catch (err) {
}
objectMap.set(obj.key, val)
objectMap.set(obj.key, val)
}

return stmt.expandObjects(objectMap)
Expand Down
2 changes: 1 addition & 1 deletion test/peer/merge_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const { Statement } = require('../../src/model/statement')
const serialize = require('../../src/metadata/serialize')
const { PublisherId } = require('../../src/peer/identity')

import type { QueryResultMsg, StatementMsg } from '../../src/protobuf/types'
import type { QueryResultMsg } from '../../src/protobuf/types'

const TEST_NAMESPACE = 'scratch.merge-test'

Expand Down
3 changes: 0 additions & 3 deletions test/peer/push_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,7 @@ const { Statement } = require('../../src/model/statement')
const serialize = require('../../src/metadata/serialize')
const { PublisherId } = require('../../src/peer/identity')

import type { StatementMsg } from '../../src/protobuf/types'

const TEST_NAMESPACE = 'scratch.push-test'

const SEED_OBJECT_BUFFERS = [
{id: uuid.v4(), foo: 'bar'},
{id: uuid.v4(), test: 'yep'}
Expand Down
3 changes: 1 addition & 2 deletions test/peer/statement_db_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ const path = require('path')
const { StatementDB } = require('../../src/peer/db/statement-db')
const { Statement } = require('../../src/model/statement')


const MIGRATIONS_DIR = path.join(__dirname, '..', '..', 'src', 'peer', 'db', 'migrations')

const SEED_STATEMENTS: Array<Statement> = [
Expand Down Expand Up @@ -58,7 +57,7 @@ describe('Statement DB', () => {
it('can get statements by WKI', () =>
db.getByWKI('foo:bar123')
.then(results => {
const expected = SEED_STATEMENTS.filter((stmt: Statement) => stmt.body.refs.includes('foo:bar123'))
const expected = SEED_STATEMENTS.filter((stmt: Statement) => stmt.refSet.has('foo:bar123'))
assert.deepEqual(results, expected)
}))

Expand Down
1 change: 0 additions & 1 deletion test/peer/util_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ const { describe, it } = require('mocha')

const PeerInfo = require('peer-info')
const util = require('../../src/peer/util')
const serialize = require('../../src/metadata/serialize')

const statementFixtures = require('../resources/fixtures/test-statements')

Expand Down

0 comments on commit 98cfe7d

Please sign in to comment.