@Test public void equals() throws Exception { assertEquals("Equal authorities", authority, sameAuthority); assertEquals("Different authorities ", authority, differentAuthority); assertEquals("Two public keys with the same public key should be equal", keyAuthority1, keyAuthority2); }
@Override public boolean equals(Object obj) { Authority authority = (Authority) obj; HashMap<PublicKey, Long> keyAuths = authority.getKeyAuths(); HashMap<UserAccount, Long> 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; }
Authority implements GrapheneSerializable { @Override public boolean equals(Object obj) { Authority authority = (Authority) obj; HashMap<PublicKey, Long> keyAuths = authority.getKeyAuths(); HashMap<UserAccount, Long> 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; } }
Authority implements GrapheneSerializable { @Override public boolean equals(Object obj) { Authority authority = (Authority) obj; HashMap<PublicKey, Long> keyAuths = authority.getKeyAuths(); HashMap<UserAccount, Long> 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; } Authority();  Authority(long weight_threshold, HashMap<PublicKey, Long> keyAuths, HashMap<UserAccount, Long> accountAuths); }
Authority implements GrapheneSerializable { @Override public boolean equals(Object obj) { Authority authority = (Authority) obj; HashMap<PublicKey, Long> keyAuths = authority.getKeyAuths(); HashMap<UserAccount, Long> 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; } Authority();  Authority(long weight_threshold, HashMap<PublicKey, Long> keyAuths, HashMap<UserAccount, Long> accountAuths); long getWeightThreshold(); void setWeightThreshold(long weight_threshold); void setKeyAuthorities(HashMap<Address, Long> keyAuths); void setAccountAuthorities(HashMap<UserAccount, Long> accountAuthorities); List<PublicKey> getKeyAuthList(); List<UserAccount> getAccountAuthList(); HashMap<PublicKey, Long> getKeyAuths(); HashMap<UserAccount, Long> getAccountAuths(); @Override String toJsonString(); @Override JsonElement toJsonObject(); @Override byte[] toBytes(); @Override boolean equals(Object obj); }
Authority implements GrapheneSerializable { @Override public boolean equals(Object obj) { Authority authority = (Authority) obj; HashMap<PublicKey, Long> keyAuths = authority.getKeyAuths(); HashMap<UserAccount, Long> 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; } Authority();  Authority(long weight_threshold, HashMap<PublicKey, Long> keyAuths, HashMap<UserAccount, Long> accountAuths); long getWeightThreshold(); void setWeightThreshold(long weight_threshold); void setKeyAuthorities(HashMap<Address, Long> keyAuths); void setAccountAuthorities(HashMap<UserAccount, Long> accountAuthorities); List<PublicKey> getKeyAuthList(); List<UserAccount> getAccountAuthList(); HashMap<PublicKey, Long> getKeyAuths(); HashMap<UserAccount, Long> getAccountAuths(); @Override String toJsonString(); @Override JsonElement toJsonObject(); @Override byte[] toBytes(); @Override boolean equals(Object obj); static final String KEY_ACCOUNT_AUTHS; static final String KEY_KEY_AUTHS; static final String KEY_WEIGHT_THRESHOLD; static final String KEY_EXTENSIONS; }