trac-peer 0.0.13 → 0.0.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "trac-peer",
3
3
  "main": "src/index.js",
4
- "version": "0.0.13",
4
+ "version": "0.0.15",
5
5
  "type": "module",
6
6
  "dependencies": {
7
7
  "autobase": "7.0.45",
package/src/contract.js CHANGED
@@ -12,7 +12,9 @@ class Contract {
12
12
 
13
13
  async get(key){
14
14
  if(typeof this.storage === "undefined" || this.storage === null) throw new Error('get(key): storage undefined');
15
- return await this.storage.get(key);
15
+ const result = await this.storage.get(key);
16
+ if(null === result) return null;
17
+ return result.value;
16
18
  }
17
19
 
18
20
  async put(key, value){
package/src/index.js CHANGED
@@ -170,8 +170,7 @@ export class Peer extends ReadyResource {
170
170
  this.init_contract_starting = true;
171
171
  this.protocol_instance = new this.protocol({
172
172
  peer : this,
173
- base : this.base,
174
- local_db : this.bee
173
+ base : this.base
175
174
  });
176
175
  this.contract_instance = new this.contract(this.protocol_instance);
177
176
  }