Add missing condition or fulfillment test

This commit is contained in:
wilsonianb
2017-11-06 13:49:38 -06:00
parent 227ea82a29
commit 8ed5f764fa
4 changed files with 27 additions and 1 deletions

View File

@@ -302,6 +302,20 @@ describe('RippleAPI', function() {
'prepare'));
});
it('prepareEscrowExecution - no condition', function() {
assert.throws(() => {
this.api.prepareEscrowExecution(address,
requests.prepareEscrowExecution.noCondition, instructions);
}, /"condition" and "fulfillment" fields on EscrowFinish must only be specified together./);
});
it('prepareEscrowExecution - no fulfillment', function() {
assert.throws(() => {
this.api.prepareEscrowExecution(address,
requests.prepareEscrowExecution.noFulfillment, instructions);
}, /"condition" and "fulfillment" fields on EscrowFinish must only be specified together./);
});
it('prepareEscrowCancellation', function() {
return this.api.prepareEscrowCancellation(
address,

View File

@@ -30,7 +30,9 @@ module.exports = {
},
prepareEscrowExecution: {
normal: require('./prepare-escrow-execution'),
simple: require('./prepare-escrow-execution-simple')
simple: require('./prepare-escrow-execution-simple'),
noCondition: require('./prepare-escrow-execution-no-condition'),
noFulfillment: require('./prepare-escrow-execution-no-fulfillment')
},
prepareEscrowCancellation: {
normal: require('./prepare-escrow-cancellation'),

View File

@@ -0,0 +1,5 @@
{
"owner": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
"escrowSequence": 1234,
"fulfillment": "A0028000"
}

View File

@@ -0,0 +1,5 @@
{
"owner": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
"escrowSequence": 1234,
"condition": "A0258020E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855810100"
}