mirror of
https://github.com/orbitdb/orbitdb.git
synced 2025-03-30 15:08:28 +00:00
Merge pull request #733 from orbitdb/feat/v1-fixtures
add v1 entry fixtures and tests
This commit is contained in:
commit
9dfa66b333
54
package-lock.json
generated
54
package-lock.json
generated
@ -556,9 +556,9 @@
|
||||
}
|
||||
},
|
||||
"@octokit/types": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/@octokit/types/-/types-2.0.1.tgz",
|
||||
"integrity": "sha512-YDYgV6nCzdGdOm7wy43Ce8SQ3M5DMKegB8E5sTB/1xrxOdo2yS/KgUgML2N2ZGD621mkbdrAglwTyA4NDOlFFA==",
|
||||
"version": "2.0.2",
|
||||
"resolved": "https://registry.npmjs.org/@octokit/types/-/types-2.0.2.tgz",
|
||||
"integrity": "sha512-StASIL2lgT3TRjxv17z9pAqbnI7HGu9DrJlg3sEBFfCLaMEqp+O3IQPUF6EZtQ4xkAu2ml6kMBBCtGxjvmtmuQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@types/node": ">= 8"
|
||||
@ -2996,9 +2996,9 @@
|
||||
}
|
||||
},
|
||||
"caniuse-lite": {
|
||||
"version": "1.0.30001010",
|
||||
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001010.tgz",
|
||||
"integrity": "sha512-RA5GH9YjFNea4ZQszdWgh2SC+dpLiRAg4VDQS2b5JRI45OxmbGrYocYHTa9x0bKMQUE7uvHkNPNffUr+pCxSGw==",
|
||||
"version": "1.0.30001011",
|
||||
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001011.tgz",
|
||||
"integrity": "sha512-h+Eqyn/YA6o6ZTqpS86PyRmNWOs1r54EBDcd2NTwwfsXQ8re1B38SnB+p2RKF8OUsyEIjeDU8XGec1RGO/wYCg==",
|
||||
"dev": true
|
||||
},
|
||||
"catbox": {
|
||||
@ -4503,9 +4503,9 @@
|
||||
}
|
||||
},
|
||||
"electron-to-chromium": {
|
||||
"version": "1.3.306",
|
||||
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.306.tgz",
|
||||
"integrity": "sha512-frDqXvrIROoYvikSKTIKbHbzO6M3/qC6kCIt/1FOa9kALe++c4VAJnwjSFvf1tYLEUsP2n9XZ4XSCyqc3l7A/A==",
|
||||
"version": "1.3.309",
|
||||
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.309.tgz",
|
||||
"integrity": "sha512-NZd91XD15v2UPLjYXoN/gLnkwIUQjdH4SQLpRCCQiYJH6BBkfgp5pWemBJPr1rZ2dl8Ee3o91O9Sa1QuAfZmog==",
|
||||
"dev": true
|
||||
},
|
||||
"elliptic": {
|
||||
@ -9550,7 +9550,7 @@
|
||||
}
|
||||
},
|
||||
"ipfs-log": {
|
||||
"version": "github:orbitdb/ipfs-log#824c96e869652cf6c502169c724a219b8a913e53",
|
||||
"version": "github:orbitdb/ipfs-log#ec775377deae891375371a9dd846c880f5296f32",
|
||||
"from": "github:orbitdb/ipfs-log#feat/load-opt",
|
||||
"requires": {
|
||||
"cids": "~0.7.1",
|
||||
@ -9558,7 +9558,7 @@
|
||||
"json-stringify-deterministic": "^1.0.1",
|
||||
"multihashing-async": "^0.7.0",
|
||||
"orbit-db-identity-provider": "~0.2.0",
|
||||
"orbit-db-io": "~0.1.1",
|
||||
"orbit-db-io": "github:orbitdb/orbit-db-io",
|
||||
"p-do-whilst": "^1.1.0",
|
||||
"p-each-series": "^2.1.0",
|
||||
"p-map": "^1.1.1",
|
||||
@ -10644,12 +10644,12 @@
|
||||
"dev": true
|
||||
},
|
||||
"is-symbol": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.2.tgz",
|
||||
"integrity": "sha512-HS8bZ9ox60yCJLH9snBpIwv9pYUAkcuLhSA1oero1UB5y9aiQpRA8y2ex945AOtCZL1lJDeIk3G5LthswI46Lw==",
|
||||
"version": "1.0.3",
|
||||
"resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.3.tgz",
|
||||
"integrity": "sha512-OwijhaRSgqvhm/0ZdAcXNZt9lYdKFpcRDT5ULUuYXPoT794UNOdU+gpT6Rzo7b4V2HUl/op6GqY894AZwv9faQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"has-symbols": "^1.0.0"
|
||||
"has-symbols": "^1.0.1"
|
||||
}
|
||||
},
|
||||
"is-typedarray": {
|
||||
@ -14201,7 +14201,7 @@
|
||||
}
|
||||
},
|
||||
"orbit-db-io": {
|
||||
"version": "github:orbitdb/orbit-db-io#b82c774f98d18a9fe6bc65f9ae7bf8015cf2b8aa",
|
||||
"version": "github:orbitdb/orbit-db-io#da180fdbcff825e830022dd1a2110bbb1ed4736b",
|
||||
"from": "github:orbitdb/orbit-db-io",
|
||||
"requires": {
|
||||
"cids": "^0.7.1",
|
||||
@ -14268,8 +14268,8 @@
|
||||
}
|
||||
},
|
||||
"orbit-db-store": {
|
||||
"version": "github:orbitdb/orbit-db-store#4a0da50d1f472266aa1705773b538f500e4c4063",
|
||||
"from": "github:orbitdb/orbit-db-store#feat/latest-ipfs-log",
|
||||
"version": "github:orbitdb/orbit-db-store#59dcd4905eed18ed10e91aed5e2fcd7d1bdb32eb",
|
||||
"from": "github:orbitdb/orbit-db-store",
|
||||
"requires": {
|
||||
"ipfs-log": "~4.4.0",
|
||||
"logplease": "^1.2.14",
|
||||
@ -14974,9 +14974,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"pino": {
|
||||
"version": "5.13.6",
|
||||
"resolved": "https://registry.npmjs.org/pino/-/pino-5.13.6.tgz",
|
||||
"integrity": "sha512-cYhvK4lopLnW/OtU3uRqBNsPiBt0Cdv97LGJg4yPGbGajlOjWWaODwD66q3Ynqnj6bSNw8HSofYcEOKZqh4Gcg==",
|
||||
"version": "5.14.0",
|
||||
"resolved": "https://registry.npmjs.org/pino/-/pino-5.14.0.tgz",
|
||||
"integrity": "sha512-Vj1f2wAojTGesogT0hsA/ua8ALltCOBCcA1nkEoDfnTsVWpgBu5UVSY7OdjiGmrMOKHBm24nd3nKXzyPUYJ3ig==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"fast-redact": "^2.0.0",
|
||||
@ -20374,9 +20374,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"which": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/which/-/which-2.0.1.tgz",
|
||||
"integrity": "sha512-N7GBZOTswtB9lkQBZA4+zAXrjEIWAUOB93AvzUiudRzRxhUdLURQ7D/gAIMY1gatT/LTbmbcv8SiYazy3eYB7w==",
|
||||
"version": "2.0.2",
|
||||
"resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz",
|
||||
"integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"isexe": "^2.0.0"
|
||||
@ -20744,9 +20744,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"yargs": {
|
||||
"version": "14.2.1",
|
||||
"resolved": "https://registry.npmjs.org/yargs/-/yargs-14.2.1.tgz",
|
||||
"integrity": "sha512-rZ00XIuGAoI58F0weHyCP3PAN17wJqdN/pF8eMp+imuP+jSdMCD5t4bSf5d5FKPvEDrK9zYlnhO7bFYKQ5UYow==",
|
||||
"version": "14.2.2",
|
||||
"resolved": "https://registry.npmjs.org/yargs/-/yargs-14.2.2.tgz",
|
||||
"integrity": "sha512-/4ld+4VV5RnrynMhPZJ/ZpOCGSCeghMykZ3BhdFBDa9Wy/RH6uEGNWDJog+aUlq+9OM1CFTgtYRW5Is1Po9NOA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"cliui": "^5.0.0",
|
||||
|
@ -77,7 +77,7 @@
|
||||
"lint:docs": "remark -qf -u validate-links .",
|
||||
"test:all": "npm run test:browser-multiple-tabs && npm run test",
|
||||
"test": "cross-env TEST=all mocha",
|
||||
"test:browser-multiple-tabs": "npm run build:dist && cpy dist/orbitdb.min.js ./test/browser/orbitdb.js && cpy node_modules/ipfs/dist/index.js ./test/browser/ipfs.js && cpy node_modules/orbit-db-identity-provider/dist/index-browser.min.js ./test/browser/identities.js && cpy node_modules/ipfs-log/dist/ipfslog.min.js ./test/browser/ipfslog.min.js && mocha ./test/browser/concurrent.spec.js",
|
||||
"test:browser-multiple-tabs": "npm run build:dist && cpy dist/orbitdb.min.js ./test/browser --rename=orbitdb.js && cpy node_modules/ipfs/dist/index.js ./test/browser --rename=ipfs.js && cpy node_modules/orbit-db-identity-provider/dist/index-browser.min.js ./test/browser --rename=identities.js && cpy node_modules/ipfs-log/dist/ipfslog.min.js ./test/browser && mocha ./test/browser/concurrent.spec.js",
|
||||
"build": "npm run build:es5 && npm run build:debug && npm run build:dist && npm run build:examples && npm run build:docs/toc",
|
||||
"build:examples": "webpack --config conf/webpack.example.config.js --sort-modules-by size && mkdirp examples/browser/lib && cpy node_modules/ipfs/dist/index.js examples/browser/lib/ipfs.js",
|
||||
"build:dist": "webpack --config conf/webpack.config.js --sort-modules-by size && mkdirp examples/browser/lib && cpy dist/orbitdb.min.js examples/browser/lib/orbitdb.min.js",
|
||||
|
@ -3,10 +3,10 @@
|
||||
<title>Break OrbitDB</title>
|
||||
<meta content="text/html;charset=utf-8" http-equiv="Content-Type">
|
||||
<meta content="utf-8" http-equiv="encoding">
|
||||
<script type="text/javascript" src="orbitdb.js/orbitdb.min.js" charset="utf-8"></script>
|
||||
<script type="text/javascript" src="ipfs.js/index.js" charset="utf-8"></script>
|
||||
<script type="text/javascript" src="identities.js/index-browser.min.js" charset="utf-8"></script>
|
||||
<script type="text/javascript" src="ipfslog.min.js/ipfslog.min.js" charset="utf-8"></script>
|
||||
<script type="text/javascript" src="orbitdb.js" charset="utf-8"></script>
|
||||
<script type="text/javascript" src="ipfs.js" charset="utf-8"></script>
|
||||
<script type="text/javascript" src="identities.js" charset="utf-8"></script>
|
||||
<script type="text/javascript" src="ipfslog.min.js" charset="utf-8"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div style="padding: 0px 0px 25px 0px;">
|
||||
|
@ -170,6 +170,7 @@ Object.keys(testAPIs).forEach(API => {
|
||||
|
||||
it('database has the correct access-controller', async () => {
|
||||
assert.equal(db.access.type, 'ipfs')
|
||||
assert.equal(db.options.accessControllerAddress, '/ipfs/zdpuAsYRtJLLLDibnmxWPzyRGJEqtjmJP27ppKWcLreNGGTFN')
|
||||
assert.strictEqual(db.access.write[0], '*')
|
||||
})
|
||||
|
||||
@ -183,6 +184,16 @@ Object.keys(testAPIs).forEach(API => {
|
||||
assert.equal(newEntries.length, 1)
|
||||
assert.strictEqual(newEntries[0].hash, hash)
|
||||
})
|
||||
|
||||
it('reopens db after adding new entry', async () => {
|
||||
await db.close()
|
||||
db = await orbitdb.open(v1Address, { directory: dbPath2 })
|
||||
assert.notEqual(db, null)
|
||||
await db.load()
|
||||
assert.equal(db.all.length, 101)
|
||||
const newEntries = db.all.filter(e => e.v > 1)
|
||||
assert.equal(newEntries.length, 1)
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
|
Loading…
x
Reference in New Issue
Block a user