This commit is contained in:
Chris Troutner
2020-07-18 18:37:56 -07:00
parent 3e109f33d8
commit 6553560c56
2 changed files with 5 additions and 0 deletions
+1
View File
@@ -1647,6 +1647,7 @@ class Slp {
tokenUtxos,
sendQty
)
return res.json(opReturn)
} catch (err) {
wlogger.error('Error in slp.js/generateSendOpReturn().', err)
+4
View File
@@ -817,6 +817,7 @@ describe('#SLP', () => {
assert.hasAllKeys(result, ['error'])
assert.include(result.error, 'tokenUtxos needs to be an array.')
})
it('should throw 400 if tokenUtxos is empty array', async () => {
req.body.tokenUtxos = []
@@ -826,6 +827,7 @@ describe('#SLP', () => {
assert.hasAllKeys(result, ['error'])
assert.include(result.error, 'tokenUtxos array can not be empty.')
})
// Validate sendQty input
it('should throw 400 if sendQty is missing', async () => {
req.body.tokenUtxos = [{}, {}, {}]
@@ -846,6 +848,7 @@ describe('#SLP', () => {
assert.hasAllKeys(result, ['error'])
assert.include(result.error, 'sendQty must be a number')
})
it('should throw 400 if sendQty is not a number', async () => {
req.body.tokenUtxos = [{}, {}, {}]
req.body.sendQty = 'sendQty'
@@ -856,6 +859,7 @@ describe('#SLP', () => {
assert.hasAllKeys(result, ['error'])
assert.include(result.error, 'sendQty must be a number')
})
it('should return OP_RETURN script', async () => {
req.body.tokenUtxos = [
{