Skip to content

Commit 68871c8

Browse files
MakarovSdmitry-timofeev
authored andcommitted
Apply smallish fixes (#731)
* Fix grammar * Fix code style
1 parent 49b6117 commit 68871c8

File tree

13 files changed

+44
-36
lines changed

13 files changed

+44
-36
lines changed

exonum-java-binding/core/src/main/java/com/exonum/binding/blockchain/CoreSchemaProxy.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,12 @@ final class CoreSchemaProxy {
5050

5151
private final NativeHandle nativeHandle;
5252
private final View dbView;
53-
private static final Serializer<Block> blockSerializer = BlockSerializer.INSTANCE;
54-
private static final Serializer<TransactionLocation> transactionLocationSerializer =
53+
private static final Serializer<Block> BLOCK_SERIALIZER = BlockSerializer.INSTANCE;
54+
private static final Serializer<TransactionLocation> TRANSACTION_LOCATION_SERIALIZER =
5555
TransactionLocationSerializer.INSTANCE;
56-
private static final Serializer<TransactionResult> transactionResultSerializer =
56+
private static final Serializer<TransactionResult> TRANSACTION_RESULT_SERIALIZER =
5757
TransactionResultSerializer.INSTANCE;
58-
private static final Serializer<TransactionMessage> transactionMessageSerializer =
58+
private static final Serializer<TransactionMessage> TRANSACTION_MESSAGE_SERIALIZER =
5959
StandardSerializers.transactionMessage();
6060

6161
private CoreSchemaProxy(NativeHandle nativeHandle, View dbView) {
@@ -118,7 +118,7 @@ ProofListIndexProxy<HashCode> getBlockTransactions(long blockHeight) {
118118
*/
119119
MapIndex<HashCode, Block> getBlocks() {
120120
return MapIndexProxy.newInstance(
121-
CoreIndex.BLOCKS, dbView, StandardSerializers.hash(), blockSerializer);
121+
CoreIndex.BLOCKS, dbView, StandardSerializers.hash(), BLOCK_SERIALIZER);
122122
}
123123

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

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

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

149149
/**
@@ -152,7 +152,7 @@ ProofMapIndexProxy<HashCode, TransactionResult> getTxResults() {
152152
*/
153153
MapIndex<HashCode, TransactionLocation> getTxLocations() {
154154
return MapIndexProxy.newInstance(CoreIndex.TRANSACTIONS_LOCATIONS, dbView,
155-
StandardSerializers.hash(), transactionLocationSerializer);
155+
StandardSerializers.hash(), TRANSACTION_LOCATION_SERIALIZER);
156156
}
157157

158158
/**

exonum-java-binding/core/src/main/java/com/exonum/binding/service/Schema.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@
2525
public interface Schema {
2626

2727
/**
28-
* Returns the root hashes of Merklized tables in this database schema, as of the current
29-
* state of the database. If there are no Merklized tables, returns an empty list.
28+
* Returns the root hashes of Merkelized tables in this database schema, as of the current
29+
* state of the database. If there are no Merkelized tables, returns an empty list.
3030
*
3131
* <p>This list of root hashes represents the current service state. Lists of these hashes
3232
* from each service are aggregated in a single <em>blockchain state hash</em> that reflects

exonum-java-binding/core/src/main/java/com/exonum/binding/service/Service.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,12 +80,12 @@ default Optional<String> initialize(Fork fork) {
8080
Transaction convertToTransaction(RawTransaction rawTransaction);
8181

8282
/**
83-
* Returns a list of root hashes of all Merklized tables defined by this service,
84-
* as of the given snapshot of the blockchain state. If the service doesn't have any Merklized
83+
* Returns a list of root hashes of all Merkelized tables defined by this service,
84+
* as of the given snapshot of the blockchain state. If the service doesn't have any Merkelized
8585
* tables, returns an empty list.
8686
*
8787
* <p>The core uses this list to aggregate hashes of tables defined by all services
88-
* into a single Merklized meta-map. The hash of this meta-map is considered the hash
88+
* into a single Merkelized meta-map. The hash of this meta-map is considered the hash
8989
* of the entire blockchain state and is recorded as such in blocks and Precommit messages.
9090
*
9191
* @param snapshot a snapshot of the blockchain state. Not valid after this method returns

exonum-java-binding/core/src/test/java/com/exonum/binding/blockchain/serialization/TransactionLocationSerializerTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,14 @@
2727

2828
class TransactionLocationSerializerTest {
2929

30-
private static final Serializer<TransactionLocation> serializer =
30+
private static final Serializer<TransactionLocation> SERIALIZER =
3131
TransactionLocationSerializer.INSTANCE;
3232

3333
@ParameterizedTest
3434
@MethodSource("testSource")
3535
void roundTrip(TransactionLocation expected) {
36-
byte[] bytes = serializer.toBytes(expected);
37-
TransactionLocation actual = serializer.fromBytes(bytes);
36+
byte[] bytes = SERIALIZER.toBytes(expected);
37+
TransactionLocation actual = SERIALIZER.fromBytes(bytes);
3838

3939
assertThat(actual, equalTo(expected));
4040
}

exonum-java-binding/core/src/test/java/com/exonum/binding/blockchain/serialization/TransactionResultSerializerTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,14 @@
2727

2828
class TransactionResultSerializerTest {
2929

30-
private static final Serializer<TransactionResult> serializer =
30+
private static final Serializer<TransactionResult> SERIALIZER =
3131
TransactionResultSerializer.INSTANCE;
3232

3333
@ParameterizedTest
3434
@MethodSource("testSource")
3535
void roundTrip(TransactionResult expected) {
36-
byte[] bytes = serializer.toBytes(expected);
37-
TransactionResult actual = serializer.fromBytes(bytes);
36+
byte[] bytes = SERIALIZER.toBytes(expected);
37+
TransactionResult actual = SERIALIZER.fromBytes(bytes);
3838

3939
assertThat(actual, equalTo(expected));
4040
}

exonum-java-binding/cryptocurrency-demo/src/main/java/com/exonum/binding/cryptocurrency/CryptocurrencySchema.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
/**
3232
* A schema of the cryptocurrency service.
3333
*
34-
* <p>Has one collection: Wallets (names and values) (Merklized)
34+
* <p>Has one collection: Wallets (names and values) (Merkelized)
3535
*/
3636
public final class CryptocurrencySchema implements Schema {
3737

exonum-java-binding/pom.xml

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,23 +31,29 @@
3131
<url>https://github.com/dmitry-timofeev</url>
3232
</developer>
3333

34-
<developer>
35-
<id>alexander-irbis</id>
36-
<name>Alexander Semichenkov</name>
37-
<url>https://github.com/alexander-irbis</url>
38-
</developer>
39-
4034
<developer>
4135
<id>MakarovS</id>
4236
<name>Sergei Makarov</name>
4337
<url>https://github.com/MakarovS</url>
4438
</developer>
4539

40+
<developer>
41+
<id>bullet-tooth</id>
42+
<name>Oleg Bondar</name>
43+
<url>https://github.com/bullet-tooth</url>
44+
</developer>
45+
4646
<developer>
4747
<id>vitvakatu</id>
4848
<name>Ilya Bogdanov</name>
4949
<url>https://github.com/vitvakatu</url>
5050
</developer>
51+
52+
<developer>
53+
<id>skletsun</id>
54+
<name>Sergey Kletsun</name>
55+
<url>https://github.com/skletsun</url>
56+
</developer>
5157
</developers>
5258

5359
<modules>

exonum-java-binding/qa-service/src/main/java/com/exonum/binding/qaservice/ApiController.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -394,10 +394,6 @@ static class QaPaths {
394394
@VisibleForTesting
395395
static final String SUBMIT_INCREMENT_COUNTER_TX_PATH = "/submit-increment-counter";
396396
@VisibleForTesting
397-
static final String SUBMIT_INVALID_TX_PATH = "/submit-invalid";
398-
@VisibleForTesting
399-
static final String SUBMIT_INVALID_THROWING_TX_PATH = "/submit-invalid-throwing";
400-
@VisibleForTesting
401397
static final String SUBMIT_VALID_THROWING_TX_PATH = "/submit-valid-throwing";
402398
@VisibleForTesting
403399
static final String SUBMIT_VALID_ERROR_TX_PATH = "/submit-valid-error";

exonum-java-binding/qa-service/src/main/java/com/exonum/binding/qaservice/QaSchema.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
* A schema of the QA service.
3333
*
3434
* <p>Has two collections:
35-
* (a) values of the counters (Merklized),
35+
* (a) values of the counters (Merkelized),
3636
* (b) names of the counters.
3737
*/
3838
public final class QaSchema implements Schema {

exonum-java-binding/qa-service/src/test/java/com/exonum/binding/qaservice/QaServiceImplIntegrationTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,8 @@ void getStateHashesLogsThem() throws CloseFailuresException {
128128
Snapshot view = db.createSnapshot(cleaner);
129129

130130
List<HashCode> stateHashes = service.getStateHashes(view);
131-
int numMerklizedCollections = 1;
132-
assertThat(stateHashes).hasSize(numMerklizedCollections);
131+
int numMerkelizedCollections = 1;
132+
assertThat(stateHashes).hasSize(numMerkelizedCollections);
133133

134134
List<String> logMessages = logAppender.getMessages();
135135
int expectedNumMessages = 1;

0 commit comments

Comments
 (0)