mirror of
https://github.com/fullstack-cash/bch-api.git
synced 2026-09-22 01:02:05 -07:00
Linting
This commit is contained in:
@@ -1647,6 +1647,7 @@ class Slp {
|
||||
tokenUtxos,
|
||||
sendQty
|
||||
)
|
||||
|
||||
return res.json(opReturn)
|
||||
} catch (err) {
|
||||
wlogger.error('Error in slp.js/generateSendOpReturn().', err)
|
||||
|
||||
@@ -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 = [
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user