Skip to content

Commit

Permalink
manage empty signatures. improve row ordering for stored signature
Browse files Browse the repository at this point in the history
  • Loading branch information
iturricf committed Apr 2, 2024
1 parent b3b7856 commit 247fffd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 2 additions & 3 deletions frontend/claim_sdk/eventSubscriber.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,10 @@ export class TokenDispenserEventSubscriber {
}> {
const currentTimeSec = Date.now() / 1000
let signatures: Array<ConfirmedSignatureInfo> = []
const options = this.lastSignatureSeen === undefined ? undefined : { until: this.lastSignatureSeen }
let currentBatch = await this.connection.getSignaturesForAddress(
this.programId,
{
until: this.lastSignatureSeen,
},
options,
this.connection.commitment as anchor.web3.Finality
)
if (this.lastSignatureSeen !== undefined) {
Expand Down
2 changes: 1 addition & 1 deletion frontend/scripts/influxdb.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
* Then update the parameters in .env accordingly
* source .env ts-node ./scripts/influxdb.ts
*/

import {
formatTxnEventInfo,
TokenDispenserEventSubscriber,
Expand Down Expand Up @@ -174,6 +173,7 @@ async function getLatestTxSignature(
|> range(start: -1d)
|> filter(fn: (r) => r._measurement == "latest_txn_seen")
|> filter(fn: (r) => r.network == "${network}")
|> sort(desc: true)
|> last()
|> limit(n:1)`

Expand Down

0 comments on commit 247fffd

Please sign in to comment.