Check tx proposal minimum amount

This commit is contained in:
Ivan Socolsky 2014-08-21 16:02:02 -03:00
commit ce910fe52f
5 changed files with 24 additions and 3 deletions

View file

@ -630,7 +630,7 @@ describe('Wallet model', function() {
return utxo;
};
var toAddress = 'mjfAe7YrzFujFf8ub5aUrCaN5GfSABdqjh';
var amountSatStr = '1000';
var amountSatStr = '10000';
it('should create transaction', function(done) {
var w = cachedCreateW2();
@ -641,6 +641,7 @@ describe('Wallet model', function() {
done();
});
});
it('should create & sign transaction from received funds', function(done) {
var k2 = new PrivateKey({
networkName: config.networkName
@ -724,6 +725,23 @@ describe('Wallet model', function() {
});
});
describe('#createTxSync', function () {
it('should fail if amount below min value', function() {
var w = cachedCreateW2();
var utxo = createUTXO(w);
var badCreate = function() {
w.createTxSync(
'mgGJEugdPnvhmRuFdbdQcFfoFLc1XXeB79',
'123',
null,
utxo
);
}
chai.expect(badCreate).to.throw('invalid amount');
});
});
describe('#send', function() {
it('should call this.network.send', function() {
var w = cachedCreateW2();