Skip to content

Commit e957b46

Browse files
Bug fixes
1 parent def21b5 commit e957b46

File tree

3 files changed

+2
-26
lines changed

3 files changed

+2
-26
lines changed

crawler/random.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
import seedrandom from 'seedrandom';
2-
import * as os from 'os';
32
import * as crypto from 'crypto';
43

54
const getTrueRandom = () => Math.random();
65

76
const getPseudoRandom = (batchId: number) => {
8-
const hostname = os.hostname();
97
const seed = crypto
108
.createHash('sha256')
11-
.update(`${hostname}_${batchId}`)
9+
.update(batchId.toString())
1210
.digest('hex');
1311

1412
const rng = seedrandom(seed);

lib/referral/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ export const updateReferralData = async (
7676
one.ref,
7777
one.id,
7878
one.height,
79-
Math.floor(new Date(one.ts).getTime() / 1000),
79+
Math.floor(new Date(parseInt(one.ts) | 0).getTime() / 1000),
8080
],
8181
);
8282
} catch (error) {

lib/sources/astroport/index.ts

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -136,28 +136,6 @@ export default class AstroportSource implements SourceInterface {
136136
return { results: out, nextKey: balances.pagination?.nextKey };
137137
};
138138

139-
getTotalSupply = async (
140-
token: string,
141-
height: number,
142-
): Promise<number | undefined> => {
143-
const path = '/cosmos.bank.v1beta1.Query/SupplyOf';
144-
const request = {
145-
denom: token,
146-
};
147-
const client = await this.getClient();
148-
const data = QuerySupplyOfRequest.encode(request).finish();
149-
const response = await client.abciQuery({ path, data, height });
150-
this.logger.trace('Got response %o', response);
151-
if (response.code !== 0) {
152-
throw new Error(
153-
`Tendermint query error: ${response.log} Code: ${response.code}`,
154-
);
155-
}
156-
const supply = QuerySupplyOfResponse.decode(response.value);
157-
this.logger.trace('Supply %o', supply);
158-
return parseInt(supply.amount.amount, 10);
159-
};
160-
161139
getLpExchangeRate = async (
162140
height: number,
163141
denom: string,

0 commit comments

Comments
 (0)