Skip to content

Commit

Permalink
Remove usage of validator nodeAddress
Browse files Browse the repository at this point in the history
  • Loading branch information
buberdds committed Nov 5, 2024
1 parent 6799266 commit 9b96cc7
Show file tree
Hide file tree
Showing 9 changed files with 2 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ describe('<ActiveDelegationList />', () => {
rank: 1,
status: 'active',
name: 'test-validator',
nodeAddress: 'oasis1qq7pgk9v8l3hu2aenjtflezy5vajc2cz3y4d96rj',
escrow: 1000n.toString(),
},
},
Expand Down Expand Up @@ -73,7 +72,6 @@ describe('<ActiveDelegationList />', () => {
rank: 1,
status: 'active',
name: 'test-validator1',
nodeAddress: 'oasis1qq7pgk9v8l3hu2aenjtflezy5vajc2cz3y4d96rj',
escrow: 1000n.toString(),
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ describe('<DebondingDelegationList />', () => {
rank: 1,
status: 'active',
name: 'test-validator',
nodeAddress: 'oasis1qq7pgk9v8l3hu2aenjtflezy5vajc2cz3y4d96rj',
escrow: 1000n.toString(),
},
},
Expand Down Expand Up @@ -82,7 +81,6 @@ describe('<DebondingDelegationList />', () => {
rank: 1,
status: 'active',
name: 'test-validator1',
nodeAddress: 'oasis1qq7pgk9v8l3hu2aenjtflezy5vajc2cz3y4d96rj',
escrow: 1000n.toString(),
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ jest.mock('@oasisprotocol/client/dist/client')

const activeValidator: Validator = {
address: 'oasis1qpc4ze5zzq3aa5mu5ttu4ku4ctp5t6x0asemymfz',
nodeAddress: 'oasis1qpwrtzadlddfuvdhjlta85268ju7dj0flsrfgg5x',
current_rate: 0.1,
rank: 0,
status: 'active',
Expand All @@ -30,7 +29,6 @@ const activeValidator: Validator = {
}
const inactiveValidator: Validator = {
address: 'oasis1qzyqaxestzlum26e2vdgvkerm6d9qgdp7gh2pxqe',
nodeAddress: 'oasis1qrdlqcv3tnv7qzuucnq0fncua52n66x7n5pm3n93',
current_rate: 0.2,
rank: 1,
status: 'inactive',
Expand All @@ -40,7 +38,6 @@ const inactiveValidator: Validator = {
}
const unknownValidator: Validator = {
address: 'oasis1qrfe9n26nq3t6vc9hlu9gnupwf4rm6wr0uglh3r7',
nodeAddress: 'oasis1qq672rjh7mldhaj35mlf4w34m8jtl9vu2c8qspkz',
current_rate: 0.2,
rank: 2,
status: 'unknown',
Expand Down
2 changes: 2 additions & 0 deletions src/app/state/staking/saga.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,8 @@ describe('Staking Sagas', () => {
}
nic.schedulerGetValidators.mockResolvedValue([
{
// oasis1qq3xrq0urs8qcffhvmhfhz4p0mu7ewc8rscnlwxe
entity_id: oasis.misc.fromHex('799b9a717cb9b37fe7a2507f137805e2fa9461dbdf3a555a6815c67d9706c0a7'),
// oasis1qrg52ccz4ts6cct2qu4retxn7kkdlusjh5pe74ar
id: oasis.misc.fromHex('91e7768ae47cd1641d6f883b97e3ea6d0286240bc3e3e2953c5c2e0dce6753a3'),
voting_power: 1,
Expand Down
1 change: 0 additions & 1 deletion src/app/state/staking/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import { StringifiedBigInt } from 'types/StringifiedBigInt'
export interface Validator {
address: string
name?: string
nodeAddress: string
escrow: StringifiedBigInt
status: 'active' | 'inactive' | 'unknown'
rank: number
Expand Down
3 changes: 0 additions & 3 deletions src/vendors/__tests__/__snapshots__/monitor.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,6 @@ exports[`monitor parse validators 1`] = `
"website_link": "https://s.f",
},
"name": "s",
"nodeAddress": "oasis1qrg52ccz4ts6cct2qu4retxn7kkdlusjh5pe74ar",
"rank": 1,
"status": "active",
},
Expand All @@ -255,7 +254,6 @@ exports[`monitor parse validators 1`] = `
"website_link": "https://www.b.com",
},
"name": "b",
"nodeAddress": "oasis1qqp0h2h92eev7nsxgqctvuegt8ge3vyg0qyluc4k",
"rank": 2,
"status": "inactive",
},
Expand All @@ -269,7 +267,6 @@ exports[`monitor parse validators 1`] = `
"website_link": "https://staking.fund",
},
"name": "Staking Fund",
"nodeAddress": "oasis1qq93qrvrcfl8rpjm354h5yrjcredcvt7qclumsju",
"rank": 3,
"status": "active",
},
Expand Down
3 changes: 0 additions & 3 deletions src/vendors/__tests__/__snapshots__/oasisscan.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,6 @@ exports[`oasisscan parse validators 1`] = `
"website_link": "https://s.f",
},
"name": "s",
"nodeAddress": "oasis1qrg52ccz4ts6cct2qu4retxn7kkdlusjh5pe74ar",
"rank": 1,
"status": "active",
},
Expand All @@ -280,7 +279,6 @@ exports[`oasisscan parse validators 1`] = `
"website_link": "https://www.b.com",
},
"name": "b",
"nodeAddress": "oasis1qqp0h2h92eev7nsxgqctvuegt8ge3vyg0qyluc4k",
"rank": 2,
"status": "inactive",
},
Expand All @@ -295,7 +293,6 @@ exports[`oasisscan parse validators 1`] = `
"website_link": "https://staking.fund",
},
"name": "Staking Fund",
"nodeAddress": "oasis1qp0lt6y2kq8g7ffzy49acga2l8uefngz0yf9v0jk",
"rank": 3,
"status": "active",
},
Expand Down
1 change: 0 additions & 1 deletion src/vendors/monitor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@ export function parseValidatorsList(validators: ValidatorRow[]): Validator[] {
const parsed: Validator = {
address: v.account_id,
name: v.account_name,
nodeAddress: v.node_id,
escrow: BigInt(v.escrow_balance).toString(),
current_rate: computeCurrentRate(v.current_epoch!, v.commission_schedule?.rates ?? []),
status: v.status,
Expand Down
1 change: 0 additions & 1 deletion src/vendors/oasisscan.ts
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,6 @@ export function parseValidatorsList(validators: ValidatorRow[]): Validator[] {
const parsed: Validator = {
address: v.entityAddress,
name: v.name ?? undefined,
nodeAddress: v.nodeAddress,
escrow: parseRoseStringToBaseUnitString(v.escrow),
current_rate: v.commission,
status: v.status ? 'active' : 'inactive',
Expand Down

0 comments on commit 9b96cc7

Please sign in to comment.