This repository has been archived by the owner on Mar 10, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 299
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: support key/rm and key/rename (#641)
* feat: add key/rm * feat: add key/rename * fix: nasty CRLFs * test: run key tests from interface-ipfs-core
- Loading branch information
1 parent
72a42d6
commit 113030a
Showing
4 changed files
with
47 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
'use strict' | ||
|
||
const promisify = require('promisify-es6') | ||
|
||
module.exports = (send) => { | ||
return promisify((oldName, newName, callback) => { | ||
send({ | ||
path: 'key/rename', | ||
args: [oldName, newName] | ||
}, callback) | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
'use strict' | ||
|
||
const promisify = require('promisify-es6') | ||
|
||
module.exports = (send) => { | ||
return promisify((args, callback) => { | ||
send({ | ||
path: 'key/rm', | ||
args: args | ||
}, callback) | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/* eslint-env mocha */ | ||
|
||
'use strict' | ||
|
||
const test = require('interface-ipfs-core') | ||
const Factory = require('../ipfs-factory/client') | ||
|
||
let factory | ||
|
||
const common = { | ||
setup: function (callback) { | ||
factory = new Factory() | ||
callback(null, factory) | ||
}, | ||
teardown: function (callback) { | ||
factory.dismantle(callback) | ||
} | ||
} | ||
|
||
test.key(common) |