Skip to content

Commit

Permalink
Fix decoding of GeodeState
Browse files Browse the repository at this point in the history
  • Loading branch information
oana-barbu committed Sep 23, 2021
1 parent 2a6371b commit 875368b
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions rpc/src/geode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,7 @@ use sp_core::storage::StorageKey;
use sp_core::{blake2_128, twox_128};

use futures::{StreamExt, TryStreamExt};
use jsonrpc_core::futures::{
future::Future as Future01, sink::Sink as Sink01, stream, stream::Stream as Stream01,
};
use jsonrpc_core::futures::{future::Future, sink::Sink, stream, stream::Stream};
use jsonrpc_pubsub::{manager::SubscriptionManager, typed::Subscriber, SubscriptionId};
use log::warn;

Expand Down Expand Up @@ -264,11 +262,11 @@ fn get_geode_state(changes: StorageChangeSet) -> GeodeState {
match data {
Some(data) => {
let mut value: &[u8] = &data.0.clone();
match GeodeState::decode(&mut value) {
Ok(state) => {
return state;
match Geode::<AccountId, Hash>::decode(&mut value) {
Ok(geode) => {
return geode.state;
}
Err(_) => warn!("unable to decode GeodeState"),
Err(_) => warn!("unable to decode Geode"),
}
}
None => warn!("empty change set"),
Expand Down

0 comments on commit 875368b

Please sign in to comment.