Skip to content

Commit 4fdc48f

Browse files
authored
Added imports and removed audit path field
1 parent 1333422 commit 4fdc48f

File tree

1 file changed

+6
-14
lines changed

1 file changed

+6
-14
lines changed

code/Stakeholder.java

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,16 @@
1+
import java.nio.charset.StandardCharsets;
2+
13
/**
2-
* A stakeholder in the Merkle tree. Each stakeholder contains a name, a number
3-
* of coins and an audit path which determines the position of the stakeholder
4-
* in the stake tree. The audit path is a binary string which should be
5-
* interpreted as the position of the leaf node counted from the left. For
6-
* example "100" or decimal 4, means the stakeholder is the 4th stakeholder
7-
* in the tree.
4+
* A stakeholder in the Merkle tree. Each stakeholder has a name,
5+
* and controls an amount of coins.
86
*/
97
public class Stakeholder {
108
private final String name;
119
private final int coins;
12-
private final String auditPath;
1310

14-
public Stakeholder(String name, int coins, String auditPath) {
11+
public Stakeholder(String name, int coins) {
1512
this.name = name;
1613
this.coins = coins;
17-
this.auditPath = auditPath;
1814
}
1915

2016
public String getName() {
@@ -26,16 +22,12 @@ public int getCoins() {
2622
}
2723

2824
public byte[] toBytes() {
29-
return String.format("%s%d%s", name, coins, auditPath).
25+
return String.format("%s%d", name, coins).
3026
getBytes(StandardCharsets.US_ASCII);
3127
}
3228

3329
@Override
3430
public String toString() {
3531
return name;
3632
}
37-
38-
public String getAuditPath() {
39-
return auditPath;
40-
}
4133
}

0 commit comments

Comments
 (0)