Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
hu55a1n1 committed Mar 17, 2022
1 parent f53acfc commit 2c32896
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
8 changes: 2 additions & 6 deletions rpc/src/endpoint/genesis.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,11 @@ use tendermint::Genesis;

/// Get the genesis state for the current chain
#[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize)]
pub struct Request<AppState> {
marker: PhantomData<AppState>,
}
pub struct Request<AppState>(#[serde(skip)] PhantomData<AppState>);

impl<AppState> Default for Request<AppState> {
fn default() -> Self {
Self {
marker: PhantomData,
}
Self(PhantomData)
}
}

Expand Down
3 changes: 2 additions & 1 deletion rpc/tests/gaia_fixtures.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,8 @@ fn outgoing_fixtures() {
}
"genesis" => {
assert!(
endpoint::genesis::Request::<serde_json::Value>::from_string(content).is_ok()
endpoint::genesis::Request::<Option<serde_json::Value>>::from_string(content)
.is_ok()
)
}
"net_info" => {
Expand Down
3 changes: 2 additions & 1 deletion rpc/tests/kvstore_fixtures.rs
Original file line number Diff line number Diff line change
Expand Up @@ -728,7 +728,8 @@ fn incoming_fixtures() {
}
"genesis" => {
let result =
endpoint::genesis::Response::<serde_json::Value>::from_string(content).unwrap();
endpoint::genesis::Response::<Option<serde_json::Value>>::from_string(content)
.unwrap();
assert!(result.genesis.app_hash.is_empty());
assert_eq!(result.genesis.chain_id.as_str(), CHAIN_ID);
assert_eq!(result.genesis.consensus_params.block.max_bytes, 22020096);
Expand Down

0 comments on commit 2c32896

Please sign in to comment.