Skip to content

Commit eb6a310

Browse files
committed
Delete references to totalHMTAmountReceived
1 parent c7068ff commit eb6a310

File tree

11 files changed

+14
-33
lines changed

11 files changed

+14
-33
lines changed

packages/apps/dashboard/client/src/features/searchResults/model/addressDetailsSchema.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ const walletSchema = z.object({
1111
lockedAmount: z.string(),
1212
withdrawableAmount: z.string(),
1313
reputation: reputationSchema,
14-
totalHMTAmountReceived: z.string(),
1514
payoutCount: z.number().or(z.string()),
1615
});
1716

packages/apps/dashboard/client/src/features/searchResults/ui/WalletAddress.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ const WalletAddress: FC<Props> = ({ data }) => {
3030
reputation,
3131
withdrawableAmount,
3232
} = data;
33-
const isWallet = 'totalHMTAmountReceived' in data;
33+
const isWallet = 'payoutCount' in data;
3434

3535
return (
3636
<>
@@ -51,10 +51,10 @@ const WalletAddress: FC<Props> = ({ data }) => {
5151
</TitleSectionWrapper>
5252
{isWallet && (
5353
<TitleSectionWrapper
54-
title="Earned Payouts"
55-
tooltip="Total amount earned by participating in jobs"
54+
title="Payouts received"
55+
tooltip="Total count of payouts received by participating in jobs"
5656
>
57-
<TokenAmount amount={data?.totalHMTAmountReceived} />
57+
<TokenAmount amount={data?.payoutCount} />
5858
</TitleSectionWrapper>
5959
)}
6060
</Stack>

packages/apps/dashboard/server/src/modules/details/details.service.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -128,9 +128,6 @@ export class DetailsService {
128128
withdrawableAmount: ethers.formatEther(stakingData.withdrawableAmount),
129129
reputation: (await this.fetchOperatorReputation(chainId, address))
130130
.reputation,
131-
totalHMTAmountReceived: ethers.formatEther(
132-
workerData?.totalHMTAmountReceived || 0,
133-
),
134131
payoutCount: workerData?.payoutCount || 0,
135132
});
136133

packages/sdk/python/human-protocol-sdk/human_protocol_sdk/gql/worker.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
fragment WorkerFields on Worker {
55
id
66
address
7-
totalHMTAmountReceived
87
payoutCount
98
}
109
"""

packages/sdk/python/human-protocol-sdk/human_protocol_sdk/worker/worker_utils.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,6 @@ def get_workers(
141141
WorkerData(
142142
id=worker.get("id"),
143143
address=worker.get("address"),
144-
total_amount_received=worker.get("totalHMTAmountReceived"),
145144
payout_count=worker.get("payoutCount"),
146145
)
147146
)
@@ -215,6 +214,5 @@ def get_worker(
215214
return WorkerData(
216215
id=worker.get("id"),
217216
address=worker.get("address"),
218-
total_amount_received=worker.get("totalHMTAmountReceived"),
219217
payout_count=worker.get("payoutCount"),
220218
)

packages/sdk/python/human-protocol-sdk/test/human_protocol_sdk/worker/test_worker_utils.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,11 @@ def test_get_workers(self):
1515
mock_worker_1 = {
1616
"id": "worker1",
1717
"address": "0x1234567890123456789012345678901234567890",
18-
"totalHMTAmountReceived": "1000",
1918
"payoutCount": 5,
2019
}
2120
mock_worker_2 = {
2221
"id": "worker2",
2322
"address": "0x9876543210987654321098765432109876543210",
24-
"totalHMTAmountReceived": "2000",
2523
"payoutCount": 10,
2624
}
2725

@@ -31,7 +29,7 @@ def test_get_workers(self):
3129

3230
filter = WorkerFilter(
3331
chain_id=ChainId.POLYGON_AMOY,
34-
order_by="totalHMTAmountReceived",
32+
order_by="payoutCount",
3533
order_direction=OrderDirection.ASC,
3634
)
3735

@@ -44,7 +42,7 @@ def test_get_workers(self):
4442
"address": None,
4543
"first": 10,
4644
"skip": 0,
47-
"orderBy": "totalHMTAmountReceived",
45+
"orderBy": "payoutCount",
4846
"orderDirection": "asc",
4947
},
5048
options=None,
@@ -93,7 +91,6 @@ def test_get_worker(self):
9391
mock_worker = {
9492
"id": "worker1",
9593
"address": "0x1234567890123456789012345678901234567890",
96-
"totalHMTAmountReceived": "1000",
9794
"payoutCount": 5,
9895
}
9996

packages/sdk/typescript/human-protocol-sdk/src/graphql/queries/worker.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ export const GET_WORKER_QUERY = gql`
66
worker(id: $address) {
77
id
88
address
9-
totalHMTAmountReceived
109
payoutCount
1110
}
1211
}
@@ -34,7 +33,6 @@ export const GET_WORKERS_QUERY = (filter: IWorkersFilter) => {
3433
) {
3534
id
3635
address
37-
totalHMTAmountReceived
3836
payoutCount
3937
}
4038
}`;

packages/sdk/typescript/human-protocol-sdk/src/graphql/types.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ export type EscrowData = {
3030
export type WorkerData = {
3131
id: string;
3232
address: string;
33-
totalHMTAmountReceived: string;
3433
payoutCount: string;
3534
};
3635

packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,6 @@ export interface IStatusEventFilter extends IPagination {
181181
export interface IWorker {
182182
id: string;
183183
address: string;
184-
totalHMTAmountReceived: bigint;
185184
payoutCount: number;
186185
}
187186

packages/sdk/typescript/human-protocol-sdk/src/worker/worker_utils.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,6 @@ export class WorkerUtils {
9393
* type IWorker = {
9494
* id: string;
9595
* address: string;
96-
* totalHMTAmountReceived: bigint;
9796
* payoutCount: number;
9897
* };
9998
* ```
@@ -162,7 +161,6 @@ function mapWorker(w: WorkerData): IWorker {
162161
return {
163162
id: w.id,
164163
address: w.address,
165-
totalHMTAmountReceived: BigInt(w.totalHMTAmountReceived || 0),
166164
payoutCount: Number(w.payoutCount || 0),
167165
};
168166
}

0 commit comments

Comments
 (0)