Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SDK updated from 0.3.0 to 0.3.1 #13

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<dependency>
<groupId>io.horizen</groupId>
<artifactId>sidechains-sdk</artifactId>
<version>0.3.0</version>
<version>0.3.1</version>
</dependency>

<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
public final class SellOrderSpendingProof extends AbstractSignature25519<PrivateKey25519, SellOrderProposition> {
// To distinguish who opened the CarSellOrderBox: seller or buyer
private final boolean isSeller;
private final byte[] signatureBytes;

public static final int SIGNATURE_LENGTH = Ed25519.signatureLength();

Expand All @@ -28,7 +27,6 @@ public SellOrderSpendingProof(byte[] signatureBytes, boolean isSeller) {
throw new IllegalArgumentException(String.format("Incorrect signature length, %d expected, %d found", SIGNATURE_LENGTH,
signatureBytes.length));
this.isSeller = isSeller;
this.signatureBytes = signatureBytes;
}

public boolean isSeller() {
Expand All @@ -51,25 +49,6 @@ public boolean isValid(SellOrderProposition proposition, byte[] message) {
}
}

@Override
public byte[] bytes() {
return Bytes.concat(
new byte[] { (isSeller ? (byte)1 : (byte)0) },
signatureBytes
);
}

public static SellOrderSpendingProof parseBytes(byte[] bytes) {
int offset = 0;

boolean isSeller = bytes[offset] != 0;
offset += 1;

byte[] signatureBytes = Arrays.copyOfRange(bytes, offset, offset + SIGNATURE_LENGTH);

return new SellOrderSpendingProof(signatureBytes, isSeller);
}

@Override
public ProofSerializer serializer() {
return SellOrderSpendingProofSerializer.getSerializer();
Expand Down