Skip to content

Commit 014e051

Browse files
OttoAllmendingerllm-git
andcommitted
feat(wasm-utxo): add clippy allow annotations for boxed parameters
Add clippy::boxed_local allow annotations for methods that use Box<[T]> parameters, which are required by wasm-bindgen for passing JavaScript arrays. Issue: BTC-2786 Co-authored-by: llm-git <[email protected]>
1 parent 322a745 commit 014e051

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

packages/wasm-utxo/src/wasm/replay_protection.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ pub struct WasmReplayProtection {
1414
impl WasmReplayProtection {
1515
/// Create from output scripts directly
1616
#[wasm_bindgen]
17+
// Box<[T]> is required by wasm-bindgen for passing JavaScript arrays
18+
#[allow(clippy::boxed_local)]
1719
pub fn from_output_scripts(output_scripts: Box<[js_sys::Uint8Array]>) -> WasmReplayProtection {
1820
let scripts = output_scripts
1921
.iter()
@@ -29,6 +31,8 @@ impl WasmReplayProtection {
2931

3032
/// Create from addresses (requires network for decoding)
3133
#[wasm_bindgen]
34+
// Box<[T]> is required by wasm-bindgen for passing JavaScript arrays
35+
#[allow(clippy::boxed_local)]
3236
pub fn from_addresses(
3337
addresses: Box<[JsValue]>,
3438
network: &str,
@@ -68,6 +72,8 @@ impl WasmReplayProtection {
6872

6973
/// Create from public keys (derives P2SH-P2PK output scripts)
7074
#[wasm_bindgen]
75+
// Box<[T]> is required by wasm-bindgen for passing JavaScript arrays
76+
#[allow(clippy::boxed_local)]
7177
pub fn from_public_keys(
7278
public_keys: Box<[js_sys::Uint8Array]>,
7379
) -> Result<WasmReplayProtection, WasmUtxoError> {

0 commit comments

Comments
 (0)