|
38 | 38 | import static org.assertj.core.api.Assertions.assertThat;
|
39 | 39 | import static org.junit.jupiter.api.Assertions.assertThrows;
|
40 | 40 |
|
41 |
| -import com.exonum.binding.common.blockchain.ExecutionStatuses; |
42 | 41 | import com.exonum.binding.common.crypto.KeyPair;
|
43 | 42 | import com.exonum.binding.common.crypto.PublicKey;
|
44 | 43 | import com.exonum.binding.common.hash.HashCode;
|
|
47 | 46 | import com.exonum.binding.core.storage.database.Snapshot;
|
48 | 47 | import com.exonum.binding.core.storage.indices.MapIndex;
|
49 | 48 | import com.exonum.binding.qaservice.Config.InitialConfiguration;
|
50 |
| -import com.exonum.binding.qaservice.Service.ConfigChange; |
51 |
| -import com.exonum.binding.qaservice.Service.ConfigPropose; |
52 |
| -import com.exonum.binding.qaservice.Service.ServiceConfig; |
53 | 49 | import com.exonum.binding.testkit.EmulatedNode;
|
54 | 50 | import com.exonum.binding.testkit.FakeTimeProvider;
|
55 | 51 | import com.exonum.binding.testkit.TestKit;
|
56 | 52 | import com.exonum.binding.testkit.TestKitExtension;
|
57 | 53 | import com.exonum.binding.testkit.TimeProvider;
|
58 | 54 | import com.exonum.core.messages.Blockchain.Config;
|
59 |
| -import com.exonum.core.messages.Runtime.ExecutionStatus; |
60 | 55 | import com.google.common.collect.ImmutableMap;
|
61 | 56 | import com.google.gson.reflect.TypeToken;
|
62 | 57 | import io.vertx.core.MultiMap;
|
@@ -142,47 +137,6 @@ void initializeBadConfig() {
|
142 | 137 | assertThrows(RuntimeException.class, testKitBuilder::build);
|
143 | 138 | }
|
144 | 139 |
|
145 |
| - @Test |
146 |
| - void reconfigureService(TestKit testKit) { |
147 |
| - KeyPair serviceKeyPair = testKit.getEmulatedNode().getServiceKeyPair(); |
148 |
| - // Determine the config application height |
149 |
| - long nextHeight = 1 + testKit.applySnapshot(s -> Blockchain.newInstance(s) |
150 |
| - .getHeight()); |
151 |
| - |
152 |
| - // Propose the config change |
153 |
| - String newTimeOracleName = "mars-time"; |
154 |
| - ConfigPropose propose = ConfigPropose.newBuilder() |
155 |
| - .setActualFrom(nextHeight) |
156 |
| - .addChanges(ConfigChange.newBuilder() |
157 |
| - .setService(ServiceConfig.newBuilder() |
158 |
| - .setInstanceId(QA_SERVICE_ID) |
159 |
| - .setParams(InitialConfiguration.newBuilder() |
160 |
| - .setTimeOracleName(newTimeOracleName) |
161 |
| - .build() |
162 |
| - .toByteString()) |
163 |
| - .build()) |
164 |
| - .build()) |
165 |
| - .build(); |
166 |
| - TransactionMessage proposeTx = TransactionMessage.builder() |
167 |
| - // fixme: constants |
168 |
| - .serviceId(0) |
169 |
| - .transactionId(2) |
170 |
| - .payload(propose.toByteArray()) |
171 |
| - .sign(serviceKeyPair); |
172 |
| - testKit.createBlockWithTransactions(proposeTx); |
173 |
| - |
174 |
| - // Check the proposal status |
175 |
| - Snapshot s = testKit.getSnapshot(); |
176 |
| - Optional<ExecutionStatus> proposalStatus = Blockchain.newInstance(s) |
177 |
| - .getTxResult(proposeTx.hash()); |
178 |
| - assertThat(proposalStatus).hasValue(ExecutionStatuses.success()); |
179 |
| - |
180 |
| - // Check the application status |
181 |
| - QaSchema qaSchema = new QaSchema(s, QA_SERVICE_NAME); |
182 |
| - Optional<String> actualTimeOracle = qaSchema.timeOracleName().toOptional(); |
183 |
| - assertThat(actualTimeOracle).hasValue(newTimeOracleName); |
184 |
| - } |
185 |
| - |
186 | 140 | @Test
|
187 | 141 | void afterCommit(TestKit testKit) {
|
188 | 142 | // Create a block so that the transaction, submitted in after commit handler,
|
|
0 commit comments