Skip to content

Commit

Permalink
refactor: remove unnecessarily new and build for upgradeIntent
Browse files Browse the repository at this point in the history
  • Loading branch information
hopeyen committed Aug 14, 2023
1 parent 4c75849 commit 9790181
Showing 1 changed file with 0 additions and 18 deletions.
18 changes: 0 additions & 18 deletions subgraph-radio/src/messages/upgrade.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,24 +38,6 @@ pub struct UpgradeIntentMessage {
}

impl UpgradeIntentMessage {
pub fn new(subgraph_id: String, new_hash: String, nonce: i64, graph_account: String) -> Self {
UpgradeIntentMessage {
new_hash,
subgraph_id,
nonce,
graph_account,
}
}

pub fn build(
subgraph_id: String,
new_hash: String,
timestamp: i64,
graph_account: String,
) -> Self {
UpgradeIntentMessage::new(subgraph_id, new_hash, timestamp, graph_account)
}

/// Check duplicated fields: payload message has duplicated fields with GraphcastMessage, the values must be the same
pub fn valid_outer(&self, outer: &GraphcastMessage<Self>) -> Result<&Self, BuildMessageError> {
if self.nonce == outer.nonce && self.graph_account == outer.graph_account {
Expand Down

0 comments on commit 9790181

Please sign in to comment.