mirror of
https://github.com/Xahau/xahau.js.git
synced 2025-11-20 20:25:48 +00:00
Add missing condition or fulfillment test
This commit is contained in:
@@ -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,
|
||||
|
||||
4
test/fixtures/requests/index.js
vendored
4
test/fixtures/requests/index.js
vendored
@@ -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'),
|
||||
|
||||
5
test/fixtures/requests/prepare-escrow-execution-no-condition.json
vendored
Normal file
5
test/fixtures/requests/prepare-escrow-execution-no-condition.json
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"owner": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
|
||||
"escrowSequence": 1234,
|
||||
"fulfillment": "A0028000"
|
||||
}
|
||||
5
test/fixtures/requests/prepare-escrow-execution-no-fulfillment.json
vendored
Normal file
5
test/fixtures/requests/prepare-escrow-execution-no-fulfillment.json
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"owner": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
|
||||
"escrowSequence": 1234,
|
||||
"condition": "A0258020E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855810100"
|
||||
}
|
||||
Reference in New Issue
Block a user