better tests

This commit is contained in:
Matias Alejo Garcia 2015-02-23 15:36:35 -03:00
parent e3482e01b8
commit 74d0908aec
2 changed files with 32 additions and 27 deletions

View File

@ -95,53 +95,53 @@ bit recreate
### On the Air-gapped device
```
git genkey
git export -o wallet.dat --readonly (or --nosigning)
bit genkey
bit export -o wallet.dat --readonly (or --nosigning)
```
### Proxy machine
```
git join secret -i wallet.dat
git balance
bit join secret -i wallet.dat
bit balance
# Export pending transaction to be signed offline
git txproposals -o txproposals.dat
bit txproposals -o txproposals.dat
```
## Back to air-gapped device
### To check tx proposals:
```
git txproposals -i txproposals.dat
bit txproposals -i txproposals.dat
```
First time txproposals is running on the air gapped devices, the public keys of the copayers will be imported from the txproposals archive. That information is exported automatically by the proxy machine, and encrypted copayer's xpriv derivatives.
### Sign them
```
git sign -i txproposals.dat -o txproposals-signed.dat
bit sign -i txproposals.dat -o txproposals-signed.dat
# Or With filter
git sign e01e -i txproposals.dat -o txproposals-signed.dat
bit sign e01e -i txproposals.dat -o txproposals-signed.dat
```
## Back to proxy machine
```
git sign -i txproposals-signed.dat
bit sign -i txproposals-signed.dat
```
# Password protection (TODO)
### encrypts everything by default
```
git create myWallet 2-3 -p password
bit create myWallet 2-3 -p password
# Or (interactive mode)
git create myWallet 2-3 -p
bit create myWallet 2-3 -p
Enter password:
```
### allows readonly operations without password (encrypts xpriv, and leave readonlySigningKey unencrypted)
```
git create myWallet 2-3 -p --nopasswd:ro
bit create myWallet 2-3 -p --nopasswd:ro
```
### allows readwrite operations without password (only encrypts xpriv)
```
git create myWallet 2-3 -p --nopasswd:rw
bit create myWallet 2-3 -p --nopasswd:rw
```
# Local data

View File

@ -378,7 +378,6 @@ describe('client API ', function() {
clients[1].import(str, function(err, wallet) {
should.not.exist(err);
console.log('[clientApi.js.380]'); //TODO
clients[1].createAddress(function(err, x0) {
err.code.should.equal('NOTAUTHORIZED');
clients[0].createAddress(function(err, x0) {
@ -508,17 +507,19 @@ describe('client API ', function() {
});
it('should create from proxy from airgapped', function(done) {
// client0 -> airgapped
// client1 -> proxy
clients[0].generateKey('testnet', function(err) {
var airgapped = clients[0];
var proxy = clients[1];
airgapped.generateKey('testnet', function(err) {
should.not.exist(err);
clients[0].export({
airgapped.export({
access: 'readwrite'
}, function(err, str) {
clients[1].import(str, function(err) {
proxy.import(str, function(err) {
should.not.exist(err);
clients[1].createWallet('1', '2', 1, 1, 'testnet',
proxy.createWallet('1', '2', 1, 1, 'testnet',
function(err) {
should.not.exist(err);
// should keep cpub
@ -537,18 +538,22 @@ describe('client API ', function() {
});
it('should join from proxy from airgapped', function(done) {
// client0 -> airgapped
// client1 -> proxy
clients[0].generateKey('testnet', function(err) {
var airgapped = clients[0];
var proxy = clients[1];
var other = clients[2]; // Other copayer
airgapped.generateKey('testnet', function(err) {
should.not.exist(err);
clients[0].export({
airgapped.export({
access: 'readwrite'
}, function(err, str) {
clients[1].import(str, function(err) {
proxy.import(str, function(err) {
should.not.exist(err);
clients[2].createWallet('1', '2', 1, 2, 'testnet', function(err, secret) {
other.createWallet('1', '2', 1, 2, 'testnet', function(err, secret) {
should.not.exist(err);
clients[1].joinWallet(secret, 'john', function(err) {
proxy.joinWallet(secret, 'john', function(err) {
should.not.exist(err);
// should keep cpub
var c0 = JSON.parse(fsmock._get('client0'));