Skip to content

Commit

Permalink
Improve account search, #925
Browse files Browse the repository at this point in the history
  • Loading branch information
wliyongfeng committed Nov 6, 2024
1 parent 9a5e588 commit 66c3541
Showing 1 changed file with 1 addition and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@ const { encodeAddressByChain } = require("../../../../utils/address");
const {
utils: { isValidAddress },
} = require("@statescan/common");
const {
account: { getAddressCollection },
} = require("@statescan/mongo");

async function queryAccount(term = "") {
let address = null;
Expand All @@ -13,9 +10,7 @@ async function queryAccount(term = "") {
}

address = encodeAddressByChain(term);
const col = await getAddressCollection();
const arr = await col.find({ address }).limit(1).toArray();
return arr.length <= 0 ? null : address;
return address;
}

module.exports = {
Expand Down

0 comments on commit 66c3541

Please sign in to comment.