-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
18497ff
commit 5f45d12
Showing
15 changed files
with
193 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
src/main/java/org/arkecosystem/crypto/transactions/types/EvmCall.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
src/main/java/org/arkecosystem/crypto/transactions/types/Transfer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
src/main/java/org/arkecosystem/crypto/transactions/types/Unvote.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
src/main/java/org/arkecosystem/crypto/transactions/types/ValidatorResignation.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 4 additions & 3 deletions
7
...ilder/AbstractTransactionBuilderTest.java → ...org/arkecosystem/crypto/AbstractTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
84 changes: 84 additions & 0 deletions
84
src/test/java/org/arkecosystem/crypto/transactions/SerializerTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
package org.arkecosystem.crypto.transactions; | ||
|
||
import static org.junit.jupiter.api.Assertions.*; | ||
|
||
import org.arkecosystem.crypto.AbstractTest; | ||
import org.arkecosystem.crypto.encoding.Hex; | ||
import org.arkecosystem.crypto.transactions.builder.TransferBuilder; | ||
import org.arkecosystem.crypto.transactions.types.*; | ||
import org.junit.jupiter.api.Test; | ||
|
||
import java.util.Map; | ||
|
||
public class SerializerTest extends AbstractTest { | ||
|
||
@Test | ||
public void it_should_serialize_a_transfer_transaction() throws Exception { | ||
Map<String, Object> fixture = loadFixture("transfer"); | ||
|
||
Map<String, Object> data = (Map<String, Object>) fixture.get("data"); | ||
|
||
Transfer transaction = new Transfer(data); | ||
|
||
byte[] serializedBytes = transaction.serialize(false); | ||
String serializedHex = Hex.encode(serializedBytes); | ||
|
||
assertEquals(fixture.get("serialized"), serializedHex); | ||
} | ||
|
||
@Test | ||
public void it_should_serialize_a_vote_transaction() throws Exception { | ||
Map<String, Object> fixture = loadFixture("vote"); | ||
|
||
Map<String, Object> data = (Map<String, Object>) fixture.get("data"); | ||
|
||
Vote transaction = new Vote(data); | ||
|
||
byte[] serializedBytes = transaction.serialize(false); | ||
String serializedHex = Hex.encode(serializedBytes); | ||
|
||
assertEquals(fixture.get("serialized"), serializedHex); | ||
} | ||
|
||
@Test | ||
public void it_should_serialize_a_unvote_transaction() throws Exception { | ||
Map<String, Object> fixture = loadFixture("unvote"); | ||
|
||
Map<String, Object> data = (Map<String, Object>) fixture.get("data"); | ||
|
||
Unvote transaction = new Unvote(data); | ||
|
||
byte[] serializedBytes = transaction.serialize(false); | ||
String serializedHex = Hex.encode(serializedBytes); | ||
|
||
assertEquals(fixture.get("serialized"), serializedHex); | ||
} | ||
|
||
@Test | ||
public void it_should_serialize_a_validator_registration_transaction() throws Exception { | ||
Map<String, Object> fixture = loadFixture("validator-registration"); | ||
|
||
Map<String, Object> data = (Map<String, Object>) fixture.get("data"); | ||
|
||
ValidatorRegistration transaction = new ValidatorRegistration(data); | ||
|
||
byte[] serializedBytes = transaction.serialize(false); | ||
String serializedHex = Hex.encode(serializedBytes); | ||
|
||
assertEquals(fixture.get("serialized"), serializedHex); | ||
} | ||
|
||
@Test | ||
public void it_should_serialize_a_validator_resignation_transaction() throws Exception { | ||
Map<String, Object> fixture = loadFixture("validator-resignation"); | ||
|
||
Map<String, Object> data = (Map<String, Object>) fixture.get("data"); | ||
|
||
ValidatorResignation transaction = new ValidatorResignation(data); | ||
|
||
byte[] serializedBytes = transaction.serialize(false); | ||
String serializedHex = Hex.encode(serializedBytes); | ||
|
||
assertEquals(fixture.get("serialized"), serializedHex); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters