Skip to content

Commit

Permalink
Fixed the SQL query for /balances?account.publickey api
Browse files Browse the repository at this point in the history
Signed-off-by: Atul Mahamuni <[email protected]>
  • Loading branch information
Atul Mahamuni authored and steven-sheehy committed Sep 16, 2019
1 parent 258ffba commit 09f41ca
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
6 changes: 6 additions & 0 deletions rest-api/__tests__/accounts.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,12 @@ const singletests = {
{field: 'balance', operator: '<', value: 5432100},
]
},
accountpublickey_equal: {
urlparam: 'account.publickey=6bd7b31fd59fc1b51314ac90253dfdbffa18eec48c00051e92635fe964a08c9b',
checks: [
{field: 'ed25519_public_key_hex', operator: '=', value: '6bd7b31fd59fc1b51314ac90253dfdbffa18eec48c00051e92635fe964a08c9b'}
]
},
limit: {
urlparam: 'limit=99',
checks: [
Expand Down
6 changes: 6 additions & 0 deletions rest-api/__tests__/balances.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,12 @@ const singletests = {
{field: 'balance', operator: '<', value: 5432100},
]
},
accountpublickey_equal: {
urlparam: 'account.publickey=6bd7b31fd59fc1b51314ac90253dfdbffa18eec48c00051e92635fe964a08c9b',
checks: [
{field: 'ed25519_public_key_hex', operator: '=', value: '6bd7b31fd59fc1b51314ac90253dfdbffa18eec48c00051e92635fe964a08c9b'}
]
},
limit: {
urlparam: 'limit=99',
checks: [
Expand Down
2 changes: 1 addition & 1 deletion rest-api/balances.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ const getBalances = function (req) {
sqlQuery += " join t_entities e\n" +
" on e.entity_realm = ab.account_realm_num\n" +
" and e.entity_num = ab.account_num\n" +
" and e.entity_shard = process.env.SHARD_NUM\n" +
" and e.entity_shard = " + process.env.SHARD_NUM + "\n" +
" and e.fk_entity_type_id < " + utils.ENTITY_TYPE_FILE + "\n";
}
sqlQuery += " where " +
Expand Down

0 comments on commit 09f41ca

Please sign in to comment.