Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(drive): unable to deserialize platform state v3 #2224

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions packages/rs-drive-abci/src/platform_types/platform_state/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -547,3 +547,24 @@ impl PlatformStateV0Methods for PlatformState {
}
}
}

#[cfg(test)]
mod tests {
use super::*;

mod versioned_deserialize {
use super::*;
use crate::test::fixture::platform_state::PLATFORM_STATE_V3_TESTNET;
use platform_version::version::v3::PLATFORM_V3;
use std::ops::Deref;

#[test]
fn should_deserialize_state_v3_from_testnet() {
let serialized_state =
hex::decode(PLATFORM_STATE_V3_TESTNET.deref()).expect("failed to decode hex");

PlatformState::versioned_deserialize(&serialized_state, &PLATFORM_V3)
.expect("failed to deserialize state");
}
}
}
1 change: 1 addition & 0 deletions packages/rs-drive-abci/src/test/fixture/mod.rs
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
pub mod abci;
pub mod platform_state;
9 changes: 9 additions & 0 deletions packages/rs-drive-abci/src/test/fixture/platform_state.rs

Large diffs are not rendered by default.