Skip to content

Commit 408e186

Browse files
authored
Remove de-duping via HashSet from accounts,foriegn apps, and foreign assets setters in MethodCallTransactionBuilder. Now set solely via lists to ensure stable ordering maintained. (#652)
1 parent f3e6dcd commit 408e186

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/main/java/com/algorand/algosdk/builder/transaction/MethodCallTransactionBuilder.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212

1313
import java.math.BigInteger;
1414
import java.util.ArrayList;
15-
import java.util.HashSet;
1615
import java.util.List;
1716

1817
@SuppressWarnings("unchecked")
@@ -105,7 +104,7 @@ public T signer(TxnSigner signer) {
105104
@Override
106105
public T accounts(List<Address> accounts) {
107106
if (accounts != null)
108-
this.foreignAccounts = new ArrayList<>(new HashSet<>(accounts));
107+
this.foreignAccounts = new ArrayList<>(accounts);
109108
else
110109
this.foreignAccounts.clear();
111110
return (T) this;
@@ -114,7 +113,7 @@ public T accounts(List<Address> accounts) {
114113
@Override
115114
public T foreignApps(List<Long> foreignApps) {
116115
if (foreignApps != null)
117-
this.foreignApps = new ArrayList<>(new HashSet<>(foreignApps));
116+
this.foreignApps = new ArrayList<>(foreignApps);
118117
else
119118
this.foreignApps.clear();
120119
return (T) this;
@@ -123,7 +122,7 @@ public T foreignApps(List<Long> foreignApps) {
123122
@Override
124123
public T foreignAssets(List<Long> foreignAssets) {
125124
if (foreignAssets != null)
126-
this.foreignAssets = new ArrayList<>(new HashSet<>(foreignAssets));
125+
this.foreignAssets = new ArrayList<>(foreignAssets);
127126
else
128127
this.foreignAssets.clear();
129128
return (T) this;

0 commit comments

Comments
 (0)