mirror of
https://github.com/fluencelabs/wasm-bindgen
synced 2025-06-12 12:31:22 +00:00
Deserialize less to match schema versions
Currently the entire `Program` is deserialized to match schema versions but this is likely to fail when the schema changes. Instead just deserialize the schema/version fields, compare those, and if successful go ahead and deserialize everything.
This commit is contained in:
@ -3,6 +3,12 @@ extern crate serde_derive;
|
||||
|
||||
pub const SCHEMA_VERSION: &str = "2";
|
||||
|
||||
#[derive(Deserialize)]
|
||||
pub struct ProgramOnlySchema {
|
||||
pub schema_version: String,
|
||||
pub version: String,
|
||||
}
|
||||
|
||||
#[derive(Deserialize, Serialize)]
|
||||
pub struct Program {
|
||||
pub exports: Vec<Export>,
|
||||
|
Reference in New Issue
Block a user