Skip to content

Commit bf46a94

Browse files
fix: convert RelLockTime to numeric value in serialization
Change RelLockTime serialization to output numeric value instead of string Issue: BTC-1829
1 parent 9dce961 commit bf46a94

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

packages/wasm-miniscript/src/try_into_js_value.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ impl TryIntoJsValue for AbsLockTime {
9292

9393
impl TryIntoJsValue for RelLockTime {
9494
fn try_to_js_value(&self) -> Result<JsValue, JsError> {
95-
Ok(JsValue::from_str(&self.to_string()))
95+
Ok(JsValue::from_f64(self.to_consensus_u32() as f64))
9696
}
9797
}
9898

packages/wasm-miniscript/test/fixtures/56.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
{
3131
"ZeroNotEqual": {
3232
"Older": {
33-
"relLockTime": "2"
33+
"relLockTime": 2
3434
}
3535
}
3636
},
@@ -61,7 +61,7 @@
6161
]
6262
},
6363
{
64-
"n:older": "2"
64+
"n:older": 2
6565
}
6666
]
6767
}

packages/wasm-miniscript/test/fixtures/57.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
{
3131
"ZeroNotEqual": {
3232
"Older": {
33-
"relLockTime": "2"
33+
"relLockTime": 2
3434
}
3535
}
3636
},
@@ -61,7 +61,7 @@
6161
]
6262
},
6363
{
64-
"n:older": "2"
64+
"n:older": 2
6565
}
6666
]
6767
}

0 commit comments

Comments
 (0)