Skip to content

Commit fedb29e

Browse files
Little-Peonyclaude
andcommitted
docs: fix code accuracy issues found by codebase verification
implement-a-customized-actuator (EN+ZH): - SumContract field number: 52 is already taken by MarketSellAssetContract; change to 60 (next available number after CancelAllUnfreezeV2Contract=59) - SumActuator: add missing static import for TRANSFER_FEE from Parameter.ChainConstant (not inherited from AbstractActuator) - SumActuatorTest: Application does not have addService()/initServices()/ startServices()/shutdownServices(); replace with startup()/shutdown() which are the actual API methods Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 0cdea68 commit fedb29e

2 files changed

Lines changed: 6 additions & 12 deletions

File tree

docs/implement-a-customized-actuator-en.md

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ message Transaction {
3636
AccountCreateContract = 0;
3737
TransferContract = 1;
3838
........
39-
SumContract = 52;
39+
SumContract = 60;
4040
}
4141
...
4242
}
@@ -77,6 +77,8 @@ After compilation, the corresponding .class under the java_out directory will be
7777
For now, the default Actuator supported by java-tron is located in `org.tron.core.actuator`. Creating `SumActuator` under this directory:
7878

7979
```java
80+
import static org.tron.core.config.Parameter.ChainConstant.TRANSFER_FEE;
81+
8082
public class SumActuator extends AbstractActuator {
8183

8284
public SumActuator() {
@@ -229,11 +231,7 @@ public class SumActuatorTest {
229231
Args.setParam(new String[]{"--output-directory",
230232
temporaryFolder.newFolder().toString()}, "config-localtest.conf");
231233
context = new TronApplicationContext(DefaultConfig.class);
232-
RpcApiService rpcApiService = context.getBean(RpcApiService.class);
233234
appTest = ApplicationFactory.create(context);
234-
appTest.addService(rpcApiService);
235-
appTest.initServices(Args.getInstance());
236-
appTest.startServices();
237235
appTest.startup();
238236
channelFull = ManagedChannelBuilder.forTarget(SERVICE_NODE)
239237
.usePlaintext()
@@ -250,7 +248,6 @@ public class SumActuatorTest {
250248
channelFull.shutdown();
251249
channelFull.awaitTermination(5, TimeUnit.SECONDS);
252250
}
253-
appTest.shutdownServices();
254251
appTest.shutdown();
255252
context.destroy();
256253
Args.clearParam();

docs/implement-a-customized-actuator-zh.md

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ message Transaction {
3838
AccountCreateContract = 0;
3939
TransferContract = 1;
4040
........
41-
SumContract = 52;
41+
SumContract = 60;
4242
}
4343
...
4444
}
@@ -79,6 +79,8 @@ protoc -I=src/main/protos/api -I=src/main/protos/core -I=src/main/protos --java
7979
目前 java-tron 默认支持的 Actuator 存放在该模块的 org.tron.core.actuator 目录下,同样在该目录下创建 `SumActuator`
8080

8181
```java
82+
import static org.tron.core.config.Parameter.ChainConstant.TRANSFER_FEE;
83+
8284
public class SumActuator extends AbstractActuator {
8385

8486
public SumActuator() {
@@ -231,11 +233,7 @@ public class SumActuatorTest {
231233
Args.setParam(new String[]{"--output-directory",
232234
temporaryFolder.newFolder().toString()}, "config-localtest.conf");
233235
context = new TronApplicationContext(DefaultConfig.class);
234-
RpcApiService rpcApiService = context.getBean(RpcApiService.class);
235236
appTest = ApplicationFactory.create(context);
236-
appTest.addService(rpcApiService);
237-
appTest.initServices(Args.getInstance());
238-
appTest.startServices();
239237
appTest.startup();
240238
channelFull = ManagedChannelBuilder.forTarget(SERVICE_NODE)
241239
.usePlaintext()
@@ -252,7 +250,6 @@ public class SumActuatorTest {
252250
channelFull.shutdown();
253251
channelFull.awaitTermination(5, TimeUnit.SECONDS);
254252
}
255-
appTest.shutdownServices();
256253
appTest.shutdown();
257254
context.destroy();
258255
Args.clearParam();

0 commit comments

Comments
 (0)