OSDN Git Service

refactor
[bytom/bytom-java-sdk.git] / tx-signer / src / main / java / io / bytom / types / Spend.java
index 167361b..4743d4c 100755 (executable)
@@ -5,13 +5,13 @@ import java.util.Map;
 \r
 public class Spend extends InputEntry {\r
 \r
-    public Hash spentOutputID;\r
+    private Hash spentOutputID;\r
 \r
-    public int ordinal;\r
+    private int ordinal;\r
 \r
-    public ValueDestination witnessDestination;\r
+    private ValueDestination witnessDestination;\r
 \r
-    public byte[][] witnessArguments;\r
+    private byte[][] witnessArguments;\r
 \r
     public Spend(Hash spentOutputID, int ordinal) {\r
         this.spentOutputID = spentOutputID;\r
@@ -21,7 +21,7 @@ public class Spend extends InputEntry {
     @Override\r
     public void setDestination(Hash id, long pos, Map<Hash, Entry> entryMap) {\r
         OutputEntry spendOutput = (OutputEntry) entryMap.get(this.spentOutputID);\r
-        this.witnessDestination = new ValueDestination(id, spendOutput.source.value, pos);\r
+        this.witnessDestination = new ValueDestination(id, spendOutput.getSource().getValue(), pos);\r
     }\r
 \r
     @Override\r
@@ -33,4 +33,38 @@ public class Spend extends InputEntry {
     public void writeForHash(ByteArrayOutputStream out) {\r
         mustWriteForHash(out, this.spentOutputID);\r
     }\r
+\r
+    public Hash getSpentOutputID() {\r
+        return spentOutputID;\r
+    }\r
+\r
+    public void setSpentOutputID(Hash spentOutputID) {\r
+        this.spentOutputID = spentOutputID;\r
+    }\r
+\r
+    @Override\r
+    public int getOrdinal() {\r
+        return ordinal;\r
+    }\r
+\r
+    @Override\r
+    public void setOrdinal(int ordinal) {\r
+        this.ordinal = ordinal;\r
+    }\r
+\r
+    public ValueDestination getWitnessDestination() {\r
+        return witnessDestination;\r
+    }\r
+\r
+    public void setWitnessDestination(ValueDestination witnessDestination) {\r
+        this.witnessDestination = witnessDestination;\r
+    }\r
+\r
+    public byte[][] getWitnessArguments() {\r
+        return witnessArguments;\r
+    }\r
+\r
+    public void setWitnessArguments(byte[][] witnessArguments) {\r
+        this.witnessArguments = witnessArguments;\r
+    }\r
 }\r