diff --git a/src/main/java/de/bitsharesmunich/graphenej/Authority.java b/src/main/java/de/bitsharesmunich/graphenej/Authority.java index da01e83..54279f5 100644 --- a/src/main/java/de/bitsharesmunich/graphenej/Authority.java +++ b/src/main/java/de/bitsharesmunich/graphenej/Authority.java @@ -61,7 +61,7 @@ public class Authority implements GrapheneSerializable { this.account_auths = accountAuthorities; } - public List getKeyAuths(){ + public List getKeyAuthList(){ ArrayList keys = new ArrayList<>(); for(PublicKey pk : key_auths.keySet()){ keys.add(pk); @@ -69,6 +69,14 @@ public class Authority implements GrapheneSerializable { return keys; } + public HashMap getKeyAuths(){ + return this.key_auths; + } + + public HashMap getAccountAuths(){ + return this.account_auths; + } + @Override public String toJsonString() { return null; @@ -138,6 +146,19 @@ public class Authority implements GrapheneSerializable { return Bytes.toArray(byteArray); } + @Override + public boolean equals(Object obj) { + Authority authority = (Authority) obj; + HashMap keyAuths = authority.getKeyAuths(); + HashMap accountAuths = authority.getAccountAuths(); + System.out.println("key auths match: "+this.key_auths.equals(keyAuths)); + System.out.println("account auths match: "+this.account_auths.equals(accountAuths)); + System.out.println("weight threshold matches: "+(this.weight_threshold == authority.weight_threshold)); + return this.key_auths.equals(keyAuths) && + this.account_auths.equals(accountAuths) && + this.weight_threshold == authority.weight_threshold; + } + /** * Custom deserializer used while parsing the 'get_account_by_name' API call response. *