Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions src/mappings/poktroll/relays.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,10 @@ import { optimizedBulkCreate } from "../utils/db";
import { getBlockId, getEventId, getRelayId, messageId } from "../utils/ids";
import { parseJson, stringify } from "../utils/json";

function getClaimProofStatusFromSDK(item: typeof ClaimProofStatusSDKType | string | number): ClaimProofStatus {
// this can return undefined because older events do not have this attribute
function getClaimProofStatusFromSDK(item: typeof ClaimProofStatusSDKType | string | number): ClaimProofStatus | undefined {
if (!item) return undefined;

switch (item) {
case 0:
case ClaimProofStatusSDKType.PENDING_VALIDATION:
Expand Down Expand Up @@ -149,7 +152,7 @@ function getAttributes(attributes: CosmosEvent["event"]["attributes"]) {
// @ts-ignore
claimed: CoinSDKType = {},
failureReason = '',
proofValidationStatus: ClaimProofStatus | null = null,
proofValidationStatus: ClaimProofStatus | undefined,
settlementResult: ClaimSettlementResultSDKType | null = null,
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
Expand Down Expand Up @@ -574,11 +577,11 @@ function _handleEventApplicationOverserviced(event: CosmosEvent): EventApplicati
let expectedBurn: Coin | null = null, effectiveBurn: Coin | null = null, applicationAddress = '', supplierAddress = '';

for (const attribute of event.event.attributes) {
if (attribute.key === "application") {
if (attribute.key === "application_addr") {
applicationAddress = (attribute.value as string).replaceAll('"', '');
}

if (attribute.key === "supplier") {
if (attribute.key === "supplier_operator_addr") {
supplierAddress = (attribute.value as string).replaceAll('"', '');
}

Expand Down
Loading