Skip to content

Commit

Permalink
Merge pull request #171 from plasma-group/dev-credits
Browse files Browse the repository at this point in the history
Added credits for bdb
  • Loading branch information
smartcontracts committed Apr 8, 2019
2 parents 01ab313 + 3c67bdc commit eabfeee
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 6 deletions.
5 changes: 5 additions & 0 deletions packages/core/src/app/common/db/bucket.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/**
* Modified from bcoin's bdb (https://github.com/bcoin-org/bdb) (MIT LICENSE).
* Credit to the original author, Christopher Jeffrey (https://github.com/chjj).
*/

/* Internal Imports */
import {
Bucket,
Expand Down
5 changes: 5 additions & 0 deletions packages/core/src/app/common/db/db.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/**
* Modified from bcoin's bdb (https://github.com/bcoin-org/bdb) (MIT LICENSE).
* Credit to the original author, Christopher Jeffrey (https://github.com/chjj).
*/

/* External Imports */
import { AbstractOpenOptions, AbstractLevelDOWN } from 'abstract-leveldown'

Expand Down
5 changes: 5 additions & 0 deletions packages/core/src/app/common/db/iterator.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/**
* Modified from bcoin's bdb (https://github.com/bcoin-org/bdb) (MIT LICENSE).
* Credit to the original author, Christopher Jeffrey (https://github.com/chjj).
*/

/* External Imports */
import { AbstractIterator } from 'abstract-leveldown'

Expand Down
6 changes: 5 additions & 1 deletion packages/core/src/app/common/db/key/key.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
// TODO: Add bcoin acknowledgements for this code!
/**
* Modified from bcoin's bdb (https://github.com/bcoin-org/bdb) (MIT LICENSE).
* Credit to the original author, Christopher Jeffrey (https://github.com/chjj).
*/

/* Internal Imports */
import { Key, KeyType } from '../../../../interfaces'
import { types } from './types'
Expand Down
7 changes: 5 additions & 2 deletions packages/core/src/app/common/db/key/types.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/**
* Modified from bcoin's bdb (https://github.com/bcoin-org/bdb) (MIT LICENSE).
* Credit to the original author, Christopher Jeffrey (https://github.com/chjj).
*/

/* Internal Imports */
import {
assertType,
Expand All @@ -14,8 +19,6 @@ import {
BUFFER_MAX,
} from './utils'

// TODO: Add bcoin acknowledgements for this code!

/* tslint:disable:no-bitwise */
export const types = {
char: {
Expand Down
10 changes: 7 additions & 3 deletions packages/core/src/app/common/db/key/utils.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/* tslint:disable:no-bitwise */

// TODO: Add bcoin acknowledgements for this code!
/**
* Modified from bcoin's bdb (https://github.com/bcoin-org/bdb) (MIT LICENSE).
* Credit to the original author, Christopher Jeffrey (https://github.com/chjj).
*/

/**
* Checks a length assertion and throws an error
Expand Down Expand Up @@ -50,6 +51,7 @@ export const makeID = (id: string | number): number => {
parsed = id
}

/* tslint:disable-next-line:no-bitwise */
assert((parsed & 0xff) === parsed)
assert(parsed !== 0xff)

Expand Down Expand Up @@ -160,6 +162,8 @@ export const sizeHex = (value: Buffer | string): number => {
if (Buffer.isBuffer(value)) {
return value.length
}

/* tslint:disable-next-line:no-bitwise */
return value.length >>> 1
}

Expand Down

0 comments on commit eabfeee

Please sign in to comment.