Skip to content

Commit a505e16

Browse files
authored
Merge pull request #365 from Emurgo/ruslan/script-required-signers
[10.0.3] Added function `NativeScript.get_required_signers()`
2 parents f5563ff + 1f282a0 commit a505e16

File tree

6 files changed

+22
-4
lines changed

6 files changed

+22
-4
lines changed

package-lock.json

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "cardano-serialization-lib",
3-
"version": "10.0.2",
3+
"version": "10.0.3",
44
"description": "(De)serialization functions for the Cardano blockchain along with related utility functions",
55
"scripts": {
66
"rust:build-nodejs": "(rimraf ./rust/pkg && cd rust; wasm-pack build --target=nodejs; wasm-pack pack) && npm run js:flowgen",

rust/Cargo.lock

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

rust/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "cardano-serialization-lib"
3-
version = "10.0.2"
3+
version = "10.0.3"
44
edition = "2018"
55
authors = ["EMURGO"]
66
license = "MIT"

rust/pkg/cardano_serialization_lib.js.flow

+8
Original file line numberDiff line numberDiff line change
@@ -2798,6 +2798,14 @@ declare export class NativeScript {
27982798
* @returns {TimelockExpiry | void}
27992799
*/
28002800
as_timelock_expiry(): TimelockExpiry | void;
2801+
2802+
/**
2803+
* Returns an array of unique Ed25519KeyHashes
2804+
* contained within this script recursively on any depth level.
2805+
* The order of the keys in the result is not determined in any way.
2806+
* @returns {Ed25519KeyHashes}
2807+
*/
2808+
get_required_signers(): Ed25519KeyHashes;
28012809
}
28022810
/**
28032811
*/

rust/src/lib.rs

+10
Original file line numberDiff line numberDiff line change
@@ -1724,6 +1724,16 @@ impl NativeScript {
17241724
_ => None,
17251725
}
17261726
}
1727+
1728+
/// Returns an array of unique Ed25519KeyHashes
1729+
/// contained within this script recursively on any depth level.
1730+
/// The order of the keys in the result is not determined in any way.
1731+
pub fn get_required_signers(&self) -> Ed25519KeyHashes {
1732+
Ed25519KeyHashes(
1733+
RequiredSignersSet::from(self).iter()
1734+
.map(|k| { k.clone() }).collect()
1735+
)
1736+
}
17271737
}
17281738

17291739
#[wasm_bindgen]

0 commit comments

Comments
 (0)