Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
this.transactionsRepoMap[transactionTypes.DELEGATE] = 'transactions.delegate';
this.transactionsRepoMap[transactionTypes.IN_TRANSFER] =
'transactions.inTransfer';
this.transactionsRepoMap[transactionTypes.OUT_TRANSFER] =
'transactions.outTransfer';
this.transactionsRepoMap[transactionTypes.MULTI] =
'transactions.multisignature';
this.transactionsRepoMap[transactionTypes.SIGNATURE] =
'transactions.signature';
this.transactionsRepoMap[transactionTypes.VOTE] = 'transactions.vote';
}
var Queries = {
count: 'SELECT COUNT(*)::int AS "count" FROM trs',
countById: new PQ('SELECT COUNT(*)::int AS "count" FROM trs WHERE "id" = $1'),
countList: function(params) {
return [
'SELECT COUNT(*) FROM trs_list',
params.where.length || params.owner ? 'WHERE' : '',
params.where.length ? `(${params.where.join(' ')})` : '',
// FIXME: Backward compatibility, should be removed after transitional period
params.where.length && params.owner
? ` AND ${params.owner}`
: params.owner,
]
.filter(Boolean)
.join(' ');
},
list: function(params) {
sequenceCb => {
db
.query(
new PQ('SELECT "id" FROM blocks ORDER BY "height" DESC LIMIT 10;')
)
.then(rows => sequenceCb(null, rows))
.catch(err => sequenceCb(err, []));
},
(err, rows) => {
sequenceCb => {
db
.query(
new PQ('SELECT "id" FROM blocks ORDER BY "height" DESC LIMIT 10;')
)
.then(rows => sequenceCb(null, rows))
.catch(err => sequenceCb(err, []));
},
(err, rows) => {
sequenceCb => {
storage.adapter.db
.query(
new PQ('SELECT "id" FROM blocks ORDER BY "height" DESC LIMIT 10;')
)
.then(rows => sequenceCb(null, rows))
.catch(err => sequenceCb(err, []));
},
(err, rows) => {