Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,12 @@ final class CoreSchemaProxy {

private final NativeHandle nativeHandle;
private final View dbView;
private static final Serializer<Block> blockSerializer = BlockSerializer.INSTANCE;
private static final Serializer<TransactionLocation> transactionLocationSerializer =
private static final Serializer<Block> BLOCK_SERIALIZER = BlockSerializer.INSTANCE;
private static final Serializer<TransactionLocation> TRANSACTION_LOCATION_SERIALIZER =
TransactionLocationSerializer.INSTANCE;
private static final Serializer<TransactionResult> transactionResultSerializer =
private static final Serializer<TransactionResult> TRANSACTION_RESULT_SERIALIZER =
TransactionResultSerializer.INSTANCE;
private static final Serializer<TransactionMessage> transactionMessageSerializer =
private static final Serializer<TransactionMessage> TRANSACTION_MESSAGE_SERIALIZER =
StandardSerializers.transactionMessage();

private CoreSchemaProxy(NativeHandle nativeHandle, View dbView) {
Expand Down Expand Up @@ -118,7 +118,7 @@ ProofListIndexProxy<HashCode> getBlockTransactions(long blockHeight) {
*/
MapIndex<HashCode, Block> getBlocks() {
return MapIndexProxy.newInstance(
CoreIndex.BLOCKS, dbView, StandardSerializers.hash(), blockSerializer);
CoreIndex.BLOCKS, dbView, StandardSerializers.hash(), BLOCK_SERIALIZER);
}

/**
Expand All @@ -127,23 +127,23 @@ MapIndex<HashCode, Block> getBlocks() {
* @throws RuntimeException if the "genesis block" was not created
*/
Block getLastBlock() {
return blockSerializer.fromBytes(nativeGetLastBlock(nativeHandle.get()));
return BLOCK_SERIALIZER.fromBytes(nativeGetLastBlock(nativeHandle.get()));
}

/**
* Returns a map of transaction messages identified by their SHA-256 hashes.
*/
MapIndex<HashCode, TransactionMessage> getTxMessages() {
return MapIndexProxy.newInstance(CoreIndex.TRANSACTIONS, dbView, StandardSerializers.hash(),
transactionMessageSerializer);
TRANSACTION_MESSAGE_SERIALIZER);
}

/**
* Returns a map with a key-value pair of a transaction hash and execution result.
*/
ProofMapIndexProxy<HashCode, TransactionResult> getTxResults() {
return ProofMapIndexProxy.newInstance(CoreIndex.TRANSACTIONS_RESULTS, dbView,
StandardSerializers.hash(), transactionResultSerializer);
StandardSerializers.hash(), TRANSACTION_RESULT_SERIALIZER);
}

/**
Expand All @@ -152,7 +152,7 @@ ProofMapIndexProxy<HashCode, TransactionResult> getTxResults() {
*/
MapIndex<HashCode, TransactionLocation> getTxLocations() {
return MapIndexProxy.newInstance(CoreIndex.TRANSACTIONS_LOCATIONS, dbView,
StandardSerializers.hash(), transactionLocationSerializer);
StandardSerializers.hash(), TRANSACTION_LOCATION_SERIALIZER);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
public interface Schema {

/**
* Returns the root hashes of Merklized tables in this database schema, as of the current
* state of the database. If there are no Merklized tables, returns an empty list.
* Returns the root hashes of Merkelized tables in this database schema, as of the current
* state of the database. If there are no Merkelized tables, returns an empty list.
*
* <p>This list of root hashes represents the current service state. Lists of these hashes
* from each service are aggregated in a single <em>blockchain state hash</em> that reflects
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,12 @@ default Optional<String> initialize(Fork fork) {
Transaction convertToTransaction(RawTransaction rawTransaction);

/**
* Returns a list of root hashes of all Merklized tables defined by this service,
* as of the given snapshot of the blockchain state. If the service doesn't have any Merklized
* Returns a list of root hashes of all Merkelized tables defined by this service,
* as of the given snapshot of the blockchain state. If the service doesn't have any Merkelized
* tables, returns an empty list.
*
* <p>The core uses this list to aggregate hashes of tables defined by all services
* into a single Merklized meta-map. The hash of this meta-map is considered the hash
* into a single Merkelized meta-map. The hash of this meta-map is considered the hash
* of the entire blockchain state and is recorded as such in blocks and Precommit messages.
*
* @param snapshot a snapshot of the blockchain state. Not valid after this method returns
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@

class TransactionLocationSerializerTest {

private static final Serializer<TransactionLocation> serializer =
private static final Serializer<TransactionLocation> SERIALIZER =
TransactionLocationSerializer.INSTANCE;

@ParameterizedTest
@MethodSource("testSource")
void roundTrip(TransactionLocation expected) {
byte[] bytes = serializer.toBytes(expected);
TransactionLocation actual = serializer.fromBytes(bytes);
byte[] bytes = SERIALIZER.toBytes(expected);
TransactionLocation actual = SERIALIZER.fromBytes(bytes);

assertThat(actual, equalTo(expected));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@

class TransactionResultSerializerTest {

private static final Serializer<TransactionResult> serializer =
private static final Serializer<TransactionResult> SERIALIZER =
TransactionResultSerializer.INSTANCE;

@ParameterizedTest
@MethodSource("testSource")
void roundTrip(TransactionResult expected) {
byte[] bytes = serializer.toBytes(expected);
TransactionResult actual = serializer.fromBytes(bytes);
byte[] bytes = SERIALIZER.toBytes(expected);
TransactionResult actual = SERIALIZER.fromBytes(bytes);

assertThat(actual, equalTo(expected));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
/**
* A schema of the cryptocurrency service.
*
* <p>Has one collection: Wallets (names and values) (Merklized)
* <p>Has one collection: Wallets (names and values) (Merkelized)
*/
public final class CryptocurrencySchema implements Schema {

Expand Down
18 changes: 12 additions & 6 deletions exonum-java-binding/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,23 +31,29 @@
<url>https://github.com/dmitry-timofeev</url>
</developer>

<developer>
<id>alexander-irbis</id>
<name>Alexander Semichenkov</name>
<url>https://github.com/alexander-irbis</url>
</developer>

<developer>
<id>MakarovS</id>
<name>Sergei Makarov</name>
<url>https://github.com/MakarovS</url>
</developer>

<developer>
<id>bullet-tooth</id>
<name>Oleg Bondar</name>
<url>https://github.com/bullet-tooth</url>
</developer>

<developer>
<id>vitvakatu</id>
<name>Ilya Bogdanov</name>
<url>https://github.com/vitvakatu</url>
</developer>

<developer>
<id>skletsun</id>
<name>Sergey Kletsun</name>
<url>https://github.com/skletsun</url>
</developer>
</developers>

<modules>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -394,10 +394,6 @@ static class QaPaths {
@VisibleForTesting
static final String SUBMIT_INCREMENT_COUNTER_TX_PATH = "/submit-increment-counter";
@VisibleForTesting
static final String SUBMIT_INVALID_TX_PATH = "/submit-invalid";
@VisibleForTesting
static final String SUBMIT_INVALID_THROWING_TX_PATH = "/submit-invalid-throwing";
@VisibleForTesting
static final String SUBMIT_VALID_THROWING_TX_PATH = "/submit-valid-throwing";
@VisibleForTesting
static final String SUBMIT_VALID_ERROR_TX_PATH = "/submit-valid-error";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
* A schema of the QA service.
*
* <p>Has two collections:
* (a) values of the counters (Merklized),
* (a) values of the counters (Merkelized),
* (b) names of the counters.
*/
public final class QaSchema implements Schema {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,8 @@ void getStateHashesLogsThem() throws CloseFailuresException {
Snapshot view = db.createSnapshot(cleaner);

List<HashCode> stateHashes = service.getStateHashes(view);
int numMerklizedCollections = 1;
assertThat(stateHashes).hasSize(numMerklizedCollections);
int numMerkelizedCollections = 1;
assertThat(stateHashes).hasSize(numMerkelizedCollections);

List<String> logMessages = logAppender.getMessages();
int expectedNumMessages = 1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public MySchema(View view) {
@Override
public List<HashCode> getStateHashes() {
// You shall usually return a list of the state hashes
// of all Merklized collections of this service,
// of all Merkelized collections of this service,
// see https://exonum.com/doc/version/0.10/architecture/storage/#merkelized-indices
return Collections.emptyList();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import com.exonum.binding.service.TransactionConverter;

/**
* {@code MyTransactionConverter} converts transaction messages of {@link $.MyService}
* {@code MyTransactionConverter} converts raw transactions of {@link $.MyService}
* into {@linkplain Transaction executable transactions} of this service.
*/
public final class MyTransactionConverter implements TransactionConverter {
Expand Down
6 changes: 6 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,12 @@
<name>Ilya Bogdanov</name>
<url>https://github.com/vitvakatu</url>
</developer>

<developer>
<id>skletsun</id>
<name>Sergey Kletsun</name>
<url>https://github.com/skletsun</url>
</developer>
</developers>

<modules>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BTW, Why do we have developers/scm/issueManagement in the parent POM if it is not published anywhere (unlike ejb-parent & light-client)? Shan't we remove that as redundant?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Additionally @DENMROOT is not in this list 🙃

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From https://maven.apache.org/pom.html#Developers (from SO):

A good rule of thumb is, if the person should not be contacted about the project, they need not be listed here.

As we don't include emails here, this whole section does not seem to make much sense to me.

Expand Down