File tree Expand file tree Collapse file tree 3 files changed +2
-26
lines changed Expand file tree Collapse file tree 3 files changed +2
-26
lines changed Original file line number Diff line number Diff line change 11import seedrandom from 'seedrandom' ;
2- import * as os from 'os' ;
32import * as crypto from 'crypto' ;
43
54const getTrueRandom = ( ) => Math . random ( ) ;
65
76const 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 ) ;
Original file line number Diff line number Diff 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 ) {
Original file line number Diff line number Diff 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 ,
You can’t perform that action at this time.
0 commit comments