Skip to content

Commit

Permalink
Merge pull request #3061 from autonomys/better-type-in-rpc
Browse files Browse the repository at this point in the history
Better type in RPC
  • Loading branch information
nazar-pc authored Sep 24, 2024
2 parents f24d669 + 8a3fe0a commit b7bb137
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion crates/sc-consensus-subspace-rpc/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -553,7 +553,7 @@ where
// This will be sent to the farmer
RewardSigningInfo {
hash: hash.into(),
public_key: *public_key,
public_key,
}
},
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ where
reward_signing_info_notifications.next().await
{
// Multiple plots might have solved, only sign with correct one
if identity.public_key().to_bytes() != public_key {
if identity.public_key().to_bytes() != *public_key {
continue;
}

Expand Down
4 changes: 1 addition & 3 deletions crates/subspace-rpc-primitives/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,6 @@ pub struct SolutionResponse {
pub solution: Solution<PublicKey>,
}

// TODO: Use better types here
/// Reward info that needs to be signed.
#[derive(Clone, Copy, Debug, Encode, Decode, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
Expand All @@ -142,8 +141,7 @@ pub struct RewardSigningInfo {
#[serde(with = "hex")]
pub hash: [u8; 32],
/// Public key of the plot identity that should create signature.
#[serde(with = "hex")]
pub public_key: [u8; 32],
pub public_key: PublicKey,
}

/// Signature in response to reward hash signing request.
Expand Down

0 comments on commit b7bb137

Please sign in to comment.