WIP: sign message

This commit is contained in:
Matias Alejo Garcia 2014-11-26 08:38:02 -03:00
commit 05325b2d92
8 changed files with 202 additions and 348 deletions

View file

@ -104,11 +104,11 @@ describe('TxProposal', function() {
});
});
describe('#fromObj', function() {
describe('#fromUntrustedObj', function() {
it('should fail to create from wrong object', function() {
var b = new FakeBuilder();
(function() {
var txp = TxProposal.fromObj({
var txp = TxProposal.fromUntrustedObj({
creator: 1,
createdTs: 1,
builderObj: b.toObj(),
@ -131,7 +131,7 @@ describe('TxProposal', function() {
inputChainPaths: ['m/1'],
};
(function() {
txp = TxProposal.fromObj(o, {
txp = TxProposal.fromUntrustedObj(o, {
pepe: 100
});
}).should.throw('Invalid tx proposal: no ins');
@ -143,6 +143,9 @@ describe('TxProposal', function() {
});
});
});
describe('#fromObj', function() {
});
describe('#setSent', function() {

View file

@ -35,6 +35,7 @@ function FakeBuilder() {
this.test = 1;
this.tx = new Tx();
this.signhash = 1;
this.version =1;
this.inputMap = [{
address: '2NDJbzwzsmRgD2o5HHXPhuq5g6tkKTjYkd6',
scriptPubKey: new Script(new Buffer('a914dc0623476aefb049066b09b0147a022e6eb8429187', 'hex')),
@ -48,7 +49,6 @@ function FakeBuilder() {
address: '2NDJbzwzsmRgD2o5HHXPhuq5g6tkKTjYkd6',
amountSatStr: '123',
}]),
}
}