@@ -37,22 +37,22 @@ impl MetadataWasm {
3737 pub fn new ( options : JsValue ) -> Result < MetadataWasm , JsValue > {
3838 let metadata_options = options. with_serde_to_json_value ( ) ?;
3939 let block_height = metadata_options
40- . get_f64 ( "blockHeight" )
40+ . get_u64 ( "blockHeight" )
4141 . map_err ( |e| JsError :: new ( & e. to_string ( ) ) ) ?;
4242 let core_chain_locked_height = metadata_options
43- . get_f64 ( "coreChainLockedHeight" )
43+ . get_u32 ( "coreChainLockedHeight" )
4444 . map_err ( |e| JsError :: new ( & e. to_string ( ) ) ) ?;
4545 let time_ms = metadata_options
46- . get_f64 ( "timeMs" )
46+ . get_u64 ( "timeMs" )
4747 . map_err ( |e| JsError :: new ( & e. to_string ( ) ) ) ?;
4848 let protocol_version = metadata_options
49- . get_f64 ( "protocolVersion" )
49+ . get_u32 ( "protocolVersion" )
5050 . map_err ( |e| JsError :: new ( & e. to_string ( ) ) ) ?;
5151
5252 let inner = Metadata {
53- block_height : block_height as u64 ,
53+ block_height : block_height,
5454 core_chain_locked_height : core_chain_locked_height as u64 ,
55- time_ms : time_ms as u64 ,
55+ time_ms : time_ms,
5656 protocol_version : protocol_version as u64 as ProtocolVersion ,
5757 } ;
5858 Ok ( inner. into ( ) )
@@ -77,22 +77,22 @@ impl MetadataWasm {
7777 }
7878
7979 #[ wasm_bindgen( js_name=getBlockHeight) ]
80- pub fn block_height ( & self ) -> f64 {
81- self . 0 . block_height as f64
80+ pub fn block_height ( & self ) -> u64 {
81+ self . 0 . block_height
8282 }
8383
8484 #[ wasm_bindgen( js_name=getCoreChainLockedHeight) ]
85- pub fn core_chain_locked_height ( & self ) -> f64 {
86- self . 0 . core_chain_locked_height as f64
85+ pub fn core_chain_locked_height ( & self ) -> u32 {
86+ self . 0 . core_chain_locked_height as u32
8787 }
8888
8989 #[ wasm_bindgen( js_name=getTimeMs) ]
90- pub fn time_ms ( & self ) -> f64 {
91- self . 0 . time_ms as f64
90+ pub fn time_ms ( & self ) -> u64 {
91+ self . 0 . time_ms as u64
9292 }
9393
9494 #[ wasm_bindgen( js_name=getProtocolVersion) ]
95- pub fn protocol_version ( & self ) -> f64 {
96- self . 0 . protocol_version as f64
95+ pub fn protocol_version ( & self ) -> u32 {
96+ self . 0 . protocol_version as u32
9797 }
9898}
0 commit comments