Skip to content

Commit

Permalink
fix(deps): update dependency better-sqlite3 to v7 (#3661)
Browse files Browse the repository at this point in the history
  • Loading branch information
renovate[bot] authored May 3, 2020
1 parent 3be635e commit 932cfec
Show file tree
Hide file tree
Showing 5 changed files with 106 additions and 28 deletions.
2 changes: 1 addition & 1 deletion __mocks__/better-sqlite3.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ const BetterSqlite3 = jest.requireActual("better-sqlite3");

module.exports = class BetterSqlite3Mock extends BetterSqlite3 {
constructor(path, options = {}) {
super(path, Object.assign({}, options, { memory: true }));
super(path || ":memory:", options);
}
};
22 changes: 11 additions & 11 deletions __tests__/unit/core-transaction-pool/storage.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,14 @@ const transaction2 = Transactions.BuilderFactory.transfer()

describe("Storage.boot", () => {
it("should instantiate BetterSqlite3 using configured filename", () => {
configuration.getRequired.mockReturnValueOnce("database.db"); // storage
configuration.getRequired.mockReturnValueOnce(":memory:"); // storage
const storage = container.resolve(Storage);
storage.boot();

try {
const database = storage["database"] as BetterSqlite3.Database;
expect(ensureFileSync).toBeCalledWith("database.db");
expect(database.name).toBe("database.db");
expect(ensureFileSync).toBeCalledWith(":memory:");
expect(database.name).toBe(":memory:");
expect(database.open).toBe(true);
} finally {
storage.dispose();
Expand All @@ -53,7 +53,7 @@ describe("Storage.boot", () => {

describe("Storage.dispose", () => {
it("should close database", () => {
configuration.getRequired.mockReturnValueOnce("database.db"); // storage
configuration.getRequired.mockReturnValueOnce(":memory:"); // storage
const storage = container.resolve(Storage);
storage.boot();
const database = storage["database"] as BetterSqlite3.Database;
Expand All @@ -66,7 +66,7 @@ describe("Storage.dispose", () => {

describe("Storage.hasTransaction", () => {
it("should find transaction that was added", () => {
configuration.getRequired.mockReturnValueOnce("database.db"); // storage
configuration.getRequired.mockReturnValueOnce(":memory:"); // storage
const storage = container.resolve(Storage);
storage.boot();

Expand All @@ -80,7 +80,7 @@ describe("Storage.hasTransaction", () => {
});

it("should not find transaction that wasn't added", () => {
configuration.getRequired.mockReturnValueOnce("database.db"); // storage
configuration.getRequired.mockReturnValueOnce(":memory:"); // storage
const storage = container.resolve(Storage);
storage.boot();

Expand All @@ -96,7 +96,7 @@ describe("Storage.hasTransaction", () => {

describe("Storage.getAllTransactions", () => {
it("should return all added transactions", () => {
configuration.getRequired.mockReturnValueOnce("database.db"); // storage
configuration.getRequired.mockReturnValueOnce(":memory:"); // storage
const storage = container.resolve(Storage);
storage.boot();

Expand All @@ -113,7 +113,7 @@ describe("Storage.getAllTransactions", () => {

describe("Storage.addTransaction", () => {
it("should add new transaction", () => {
configuration.getRequired.mockReturnValueOnce("database.db"); // storage
configuration.getRequired.mockReturnValueOnce(":memory:"); // storage
const storage = container.resolve(Storage);
storage.boot();

Expand All @@ -127,7 +127,7 @@ describe("Storage.addTransaction", () => {
});

it("should throw when adding same transaction twice", () => {
configuration.getRequired.mockReturnValueOnce("database.db"); // storage
configuration.getRequired.mockReturnValueOnce(":memory:"); // storage
const storage = container.resolve(Storage);
storage.boot();

Expand All @@ -143,7 +143,7 @@ describe("Storage.addTransaction", () => {

describe("Storage.removeTransaction", () => {
it("should remove previously added transaction", () => {
configuration.getRequired.mockReturnValueOnce("database.db"); // storage
configuration.getRequired.mockReturnValueOnce(":memory:"); // storage
const storage = container.resolve(Storage);
storage.boot();

Expand All @@ -160,7 +160,7 @@ describe("Storage.removeTransaction", () => {

describe("Storage.flush", () => {
it("should remove all previously added transactions", () => {
configuration.getRequired.mockReturnValueOnce("database.db"); // storage
configuration.getRequired.mockReturnValueOnce(":memory:"); // storage
const storage = container.resolve(Storage);
storage.boot();

Expand Down
2 changes: 1 addition & 1 deletion packages/core-p2p/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"@hapi/joi": "^17.1.1",
"@hapi/boom": "^9.0.0",
"ajv": "^6.10.2",
"better-sqlite3": "^5.4.3",
"better-sqlite3": "^7.0.0",
"dayjs": "^1.8.17",
"delay": "^4.3.0",
"fs-extra": "^8.1.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/core-transaction-pool/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"@arkecosystem/crypto": "^3.0.0-next.0",
"@types/better-sqlite3": "^5.4.0",
"@types/fs-extra": "^8.0.1",
"better-sqlite3": "^5.4.3",
"better-sqlite3": "^7.0.0",
"fs-extra": "^8.1.0",
"lodash.differencewith": "^4.5.0"
},
Expand Down
106 changes: 92 additions & 14 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3906,13 +3906,14 @@ benchmark@^2.1.4:
lodash "^4.17.4"
platform "^1.3.3"

better-sqlite3@^5.4.3:
version "5.4.3"
resolved "https://registry.yarnpkg.com/better-sqlite3/-/better-sqlite3-5.4.3.tgz#2cb843ce14c56de9e9c0ca6b89844b7d4b5794b8"
integrity sha512-fPp+8f363qQIhuhLyjI4bu657J/FfMtgiiHKfaTsj3RWDkHlWC1yT7c6kHZDnBxzQVoAINuzg553qKmZ4F1rEw==
better-sqlite3@^7.0.0:
version "7.0.1"
resolved "https://registry.yarnpkg.com/better-sqlite3/-/better-sqlite3-7.0.1.tgz#7d086130b42d7d5c9d2847899c57ee59eec9cbb3"
integrity sha512-fsVcoGXxnseNajbfFbth0BKnDWebPY6x77UWfrBHApCKq1yo41DlWnFsffOsLpjkQ4VKgDU5C3aUtiw3wGGU0Q==
dependencies:
integer "^2.1.0"
tar "^4.4.10"
bindings "^1.5.0"
prebuild-install "^5.3.3"
tar "4.4.10"

big.js@^5.2.2:
version "5.2.2"
Expand All @@ -3932,7 +3933,7 @@ binary@^0.3.0:
buffers "~0.1.1"
chainsaw "~0.1.0"

bindings@^1.3.0:
bindings@^1.3.0, bindings@^1.5.0:
version "1.5.0"
resolved "https://registry.yarnpkg.com/bindings/-/bindings-1.5.0.tgz#10353c9e945334bc0511a6d90b38fbc7c9c504df"
integrity sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==
Expand Down Expand Up @@ -5235,6 +5236,13 @@ decompress-response@^3.3.0:
dependencies:
mimic-response "^1.0.0"

decompress-response@^4.2.0:
version "4.2.1"
resolved "https://registry.yarnpkg.com/decompress-response/-/decompress-response-4.2.1.tgz#414023cc7a302da25ce2ec82d0d5238ccafd8986"
integrity sha512-jOSne2qbyE+/r8G1VU+G/82LBs2Fs4LAsTiLSHOCOMZQl2OKZ6i8i4IyHemTe+/yIXOtTcRQMzPcgyhoFlqPkw==
dependencies:
mimic-response "^2.0.0"

decompress-response@^5.0.0:
version "5.0.0"
resolved "https://registry.yarnpkg.com/decompress-response/-/decompress-response-5.0.0.tgz#7849396e80e3d1eba8cb2f75ef4930f76461cb0f"
Expand Down Expand Up @@ -5437,7 +5445,7 @@ detect-indent@^6.0.0:
resolved "https://registry.yarnpkg.com/detect-indent/-/detect-indent-6.0.0.tgz#0abd0f549f69fc6659a254fe96786186b6f528fd"
integrity sha512-oSyFlqaTHCItVRGK5RmrmjB+CmaMOW7IaNA/kdxqhoa6d17j/5ce9O9eWXmV/KEdRwqpQA+Vqe8a8Bsybu4YnA==

detect-libc@^1.0.2:
detect-libc@^1.0.2, detect-libc@^1.0.3:
version "1.0.3"
resolved "https://registry.yarnpkg.com/detect-libc/-/detect-libc-1.0.3.tgz#fa137c4bd698edf55cd5cd02ac559f91a4c4ba9b"
integrity sha1-+hN8S9aY7fVc1c0CrFWfkaTEups=
Expand Down Expand Up @@ -6043,6 +6051,11 @@ expand-brackets@^2.1.4:
snapdragon "^0.8.1"
to-regex "^3.0.1"

expand-template@^2.0.3:
version "2.0.3"
resolved "https://registry.yarnpkg.com/expand-template/-/expand-template-2.0.3.tgz#6e14b3fcee0f3a6340ecb57d2e8918692052a47c"
integrity sha512-XYfuKMvj4O35f/pOXLObndIRvyQ+/+6AhODh+OKWj9S9498pHHn/IMszH+gt0fBCRWMNfk1ZSp5x3AifmnI2vg==

expect@^24.1.0:
version "24.9.0"
resolved "https://registry.yarnpkg.com/expect/-/expect-24.9.0.tgz#b75165b4817074fa4a157794f46fe9f1ba15b6ca"
Expand Down Expand Up @@ -6712,6 +6725,11 @@ gitconfiglocal@^1.0.0:
dependencies:
ini "^1.3.2"

github-from-package@0.0.0:
version "0.0.0"
resolved "https://registry.yarnpkg.com/github-from-package/-/github-from-package-0.0.0.tgz#97fb5d96bfde8973313f20e8288ef9a167fa64ce"
integrity sha1-l/tdlr/eiXMxPyDoKI75oWf6ZM4=

github-slugger@^1.2.1:
version "1.2.1"
resolved "https://registry.yarnpkg.com/github-slugger/-/github-slugger-1.2.1.tgz#47e904e70bf2dccd0014748142d31126cfd49508"
Expand Down Expand Up @@ -7359,11 +7377,6 @@ inquirer@^7.0.0:
strip-ansi "^5.1.0"
through "^2.3.6"

integer@^2.1.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/integer/-/integer-2.1.0.tgz#29134ea2f7ba3362ed4dbe6bcca992b1f18ff276"
integrity sha512-vBtiSgrEiNocWvvZX1RVfeOKa2mCHLZQ2p9nkQkQZ/BvEiY+6CcUz0eyjvIiewjJoeNidzg2I+tpPJvpyspL1w==

interpret@^1.0.0:
version "1.2.0"
resolved "https://registry.yarnpkg.com/interpret/-/interpret-1.2.0.tgz#d5061a6224be58e8083985f5014d844359576296"
Expand Down Expand Up @@ -9496,6 +9509,11 @@ nanomatch@^1.2.13, nanomatch@^1.2.9:
snapdragon "^0.8.1"
to-regex "^3.0.1"

napi-build-utils@^1.0.1:
version "1.0.2"
resolved "https://registry.yarnpkg.com/napi-build-utils/-/napi-build-utils-1.0.2.tgz#b1fddc0b2c46e380a0b7a76f984dd47c41a13806"
integrity sha512-ONmRUqK7zj7DWX0D9ADe03wbwOBZxNAfF20PlGfCWQcD3+/MakShIHrMqx9YwPTfxDdF1zLeL+RGZiR9kGMLdg==

natural-compare@^1.4.0:
version "1.4.0"
resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7"
Expand Down Expand Up @@ -9576,6 +9594,13 @@ nock@^12.0.3:
lodash "^4.17.13"
propagate "^2.0.0"

node-abi@^2.7.0:
version "2.16.0"
resolved "https://registry.yarnpkg.com/node-abi/-/node-abi-2.16.0.tgz#7df94e9c0a7a189f4197ab84bac8089ef5894992"
integrity sha512-+sa0XNlWDA6T+bDLmkCUYn6W5k5W6BPRL6mqzSCs6H/xUgtl4D5x2fORKDzopKiU6wsyn/+wXlRXwXeSp+mtoA==
dependencies:
semver "^5.4.1"

node-alias@^1.0.4:
version "1.0.4"
resolved "https://registry.yarnpkg.com/node-alias/-/node-alias-1.0.4.tgz#1f1b916b56b9ea241c0135f97ced6940f556f292"
Expand Down Expand Up @@ -9692,6 +9717,11 @@ nodejs-tail@^1.1.0:
dependencies:
chokidar "2.1.2"

noop-logger@^0.1.1:
version "0.1.1"
resolved "https://registry.yarnpkg.com/noop-logger/-/noop-logger-0.1.1.tgz#94a2b1633c4f1317553007d8966fd0e841b6a4c2"
integrity sha1-lKKxYzxPExdVMAfYlm/Q6EG2pMI=

"nopt@2 || 3", nopt@^3.0.1:
version "3.0.6"
resolved "https://registry.yarnpkg.com/nopt/-/nopt-3.0.6.tgz#c6465dbf08abcd4db359317f79ac68a646b28ff9"
Expand Down Expand Up @@ -9894,7 +9924,7 @@ npm-run-path@^4.0.0:
dependencies:
path-key "^3.0.0"

"npmlog@0 || 1 || 2 || 3 || 4", npmlog@^4.0.2, npmlog@^4.1.2:
"npmlog@0 || 1 || 2 || 3 || 4", npmlog@^4.0.1, npmlog@^4.0.2, npmlog@^4.1.2:
version "4.1.2"
resolved "https://registry.yarnpkg.com/npmlog/-/npmlog-4.1.2.tgz#08a7f2a8bf734604779a9efa4ad5cc717abb954b"
integrity sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg==
Expand Down Expand Up @@ -10695,6 +10725,27 @@ postgres-interval@^1.1.0:
dependencies:
xtend "^4.0.0"

prebuild-install@^5.3.3:
version "5.3.3"
resolved "https://registry.yarnpkg.com/prebuild-install/-/prebuild-install-5.3.3.tgz#ef4052baac60d465f5ba6bf003c9c1de79b9da8e"
integrity sha512-GV+nsUXuPW2p8Zy7SarF/2W/oiK8bFQgJcncoJ0d7kRpekEA0ftChjfEaF9/Y+QJEc/wFR7RAEa8lYByuUIe2g==
dependencies:
detect-libc "^1.0.3"
expand-template "^2.0.3"
github-from-package "0.0.0"
minimist "^1.2.0"
mkdirp "^0.5.1"
napi-build-utils "^1.0.1"
node-abi "^2.7.0"
noop-logger "^0.1.1"
npmlog "^4.0.1"
pump "^3.0.0"
rc "^1.2.7"
simple-get "^3.0.3"
tar-fs "^2.0.0"
tunnel-agent "^0.6.0"
which-pm-runs "^1.0.0"

precinct@^6.2.0:
version "6.2.0"
resolved "https://registry.yarnpkg.com/precinct/-/precinct-6.2.0.tgz#1755c369316d58ffeed2332a31442d5498f3cc33"
Expand Down Expand Up @@ -11836,6 +11887,20 @@ signal-exit@^3.0.0, signal-exit@^3.0.2:
resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.2.tgz#b5fdc08f1287ea1178628e415e25132b73646c6d"
integrity sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=

simple-concat@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/simple-concat/-/simple-concat-1.0.0.tgz#7344cbb8b6e26fb27d66b2fc86f9f6d5997521c6"
integrity sha1-c0TLuLbib7J9ZrL8hvn21Zl1IcY=

simple-get@^3.0.3:
version "3.1.0"
resolved "https://registry.yarnpkg.com/simple-get/-/simple-get-3.1.0.tgz#b45be062435e50d159540b576202ceec40b9c6b3"
integrity sha512-bCR6cP+aTdScaQCnQKbPKtJOKDp/hj9EDLJo3Nw4y1QksqaovlW/bnptB6/c1e+qmNIDHRK+oXFDdEqBT8WzUA==
dependencies:
decompress-response "^4.2.0"
once "^1.3.1"
simple-concat "^1.0.0"

simple-git@^2.0.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/simple-git/-/simple-git-2.1.0.tgz#5f079dd522d46d90acef3c1d4b208b5a3954a5d7"
Expand Down Expand Up @@ -12473,6 +12538,19 @@ tar-stream@^2.0.0:
inherits "^2.0.3"
readable-stream "^3.1.1"

tar@4.4.10:
version "4.4.10"
resolved "https://registry.yarnpkg.com/tar/-/tar-4.4.10.tgz#946b2810b9a5e0b26140cf78bea6b0b0d689eba1"
integrity sha512-g2SVs5QIxvo6OLp0GudTqEf05maawKUxXru104iaayWA09551tFCTI8f1Asb4lPfkBr91k07iL4c11XO3/b0tA==
dependencies:
chownr "^1.1.1"
fs-minipass "^1.2.5"
minipass "^2.3.5"
minizlib "^1.2.1"
mkdirp "^0.5.0"
safe-buffer "^5.1.2"
yallist "^3.0.3"

tar@^4, tar@^4.4.10, tar@^4.4.12, tar@^4.4.8:
version "4.4.13"
resolved "https://registry.yarnpkg.com/tar/-/tar-4.4.13.tgz#43b364bc52888d555298637b10d60790254ab525"
Expand Down

0 comments on commit 932cfec

Please sign in to comment.