mirror of
https://github.com/sparrowwallet/drongo.git
synced 2024-12-26 18:16:45 +00:00
show only addressable script types
This commit is contained in:
parent
6135338df2
commit
687e235c94
1 changed files with 4 additions and 0 deletions
|
@ -1039,6 +1039,10 @@ public enum ScriptType {
|
||||||
return Arrays.stream(values()).filter(scriptType -> scriptType.isAllowed(policyType)).collect(Collectors.toList());
|
return Arrays.stream(values()).filter(scriptType -> scriptType.isAllowed(policyType)).collect(Collectors.toList());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static List<ScriptType> getAddressableScriptTypes(PolicyType policyType) {
|
||||||
|
return Arrays.stream(values()).filter(scriptType -> scriptType.isAllowed(policyType) && Arrays.asList(SINGLE_HASH_TYPES).contains(scriptType)).collect(Collectors.toList());
|
||||||
|
}
|
||||||
|
|
||||||
public static ScriptType getType(Script script) {
|
public static ScriptType getType(Script script) {
|
||||||
for(ScriptType type : values()) {
|
for(ScriptType type : values()) {
|
||||||
if(type.isScriptType(script)) {
|
if(type.isScriptType(script)) {
|
||||||
|
|
Loading…
Reference in a new issue