Skip to content

Commit

Permalink
fix: remove unused validator stake view type (#8986)
Browse files Browse the repository at this point in the history
Unclear why this is here, opening it just to see if anything breaks, and see what does. Curious if it's a refactor that's broken this support, as I've gotten some server-side RPC errors relating to this type.
  • Loading branch information
austinabell committed May 2, 2023
1 parent 416b38c commit a5ed70b
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 28 deletions.
20 changes: 2 additions & 18 deletions core/primitives/src/views.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1665,16 +1665,11 @@ pub struct FinalExecutionOutcomeWithReceiptView {
}

pub mod validator_stake_view {
pub use super::ValidatorStakeViewV1;
use crate::types::validator_stake::ValidatorStake;
use borsh::{BorshDeserialize, BorshSerialize};
use near_primitives_core::types::AccountId;
use serde::{Deserialize, Serialize};

use crate::serialize::dec_format;
use near_crypto::PublicKey;
use near_primitives_core::types::Balance;

pub use super::ValidatorStakeViewV1;
use serde::Deserialize;

#[derive(
BorshSerialize, BorshDeserialize, serde::Serialize, Deserialize, Debug, Clone, Eq, PartialEq,
Expand Down Expand Up @@ -1704,17 +1699,6 @@ pub mod validator_stake_view {
}
}

#[derive(
BorshSerialize, BorshDeserialize, Serialize, Deserialize, Debug, Clone, Eq, PartialEq,
)]
pub struct ValidatorStakeViewV2 {
pub account_id: AccountId,
pub public_key: PublicKey,
#[serde(with = "dec_format")]
pub stake: Balance,
pub is_chunk_only: bool,
}

impl From<ValidatorStake> for ValidatorStakeView {
fn from(stake: ValidatorStake) -> Self {
match stake {
Expand Down
2 changes: 0 additions & 2 deletions pytest/lib/lightclient.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,6 @@ def validate_light_client_block(last_known_block,
for i in range(16):
serialized_next_bp.append(stake & 255)
stake >>= 8
if version > 0:
serialized_next_bp.append(1 if bp['is_chunk_only'] else 0)

serialized_next_bp = bytes(serialized_next_bp)

Expand Down
8 changes: 0 additions & 8 deletions pytest/lib/messages/block.py
Original file line number Diff line number Diff line change
Expand Up @@ -604,14 +604,6 @@ class ApprovalInner:
]
}
],
[
ValidatorStakeV2, {
'kind':
'struct',
'fields': [['account_id', 'string'], ['public_key', PublicKey],
['stake', 'u128'], ['is_chunk_only', 'u8']]
}
],
[
Approval, {
'kind':
Expand Down

0 comments on commit a5ed70b

Please sign in to comment.