-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix chain.get_block_txn_infos getObjectArray error. #60
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,8 +15,8 @@ | |
*/ | ||
package org.starcoin.api; | ||
|
||
import com.thetransactioncompany.jsonrpc2.client.JSONRPC2SessionException; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Tip Codebase Verification Missing JSON-RPC client dependency in build configuration files. The import statement for
Analysis chainVerify the compatibility of the new JSON-RPC client dependency. The import statement for Scripts executedThe following scripts were executed for the analysis: Script: #!/bin/bash
# Description: Verify the compatibility of the new JSON-RPC client dependency.
# Test: Search for the usage of JSONRPC2SessionException. Expect: Only occurances of the new package.
rg --type java 'JSONRPC2SessionException'
Length of output: 13047 Script: #!/bin/bash
# Description: Verify the new JSON-RPC client dependency in build configuration files.
# Test: Search for the new JSON-RPC client dependency in build configuration files.
rg --type xml 'com.thetransactioncompany.jsonrpc2'
rg --type gradle 'com.thetransactioncompany.jsonrpc2'
Length of output: 253 Script: #!/bin/bash
# Description: Verify the new JSON-RPC client dependency in build configuration files.
# Locate `pom.xml` and `build.gradle` files in the repository and search for the new JSON-RPC client dependency.
for file in $(fd -e xml -e gradle); do
echo "Checking $file"
rg 'com.thetransactioncompany.jsonrpc2' "$file"
done
Length of output: 150 |
||
import org.starcoin.bean.ContractCall; | ||
import org.starcoin.jsonrpc.client.JSONRPC2SessionException; | ||
|
||
import java.math.BigInteger; | ||
import java.net.URL; | ||
|
@@ -106,7 +106,7 @@ public BigInteger getSTCMarketCap() throws JSONRPC2SessionException { | |
/** | ||
* 用于获取 STC 在国库中的数量 | ||
*/ | ||
public BigInteger getSTCTreasurBalance() throws JSONRPC2SessionException { | ||
public BigInteger getSTCTreasuryBalance() throws JSONRPC2SessionException { | ||
nkysg marked this conversation as resolved.
Show resolved
Hide resolved
|
||
StateRPCClient stateRPCClient = new StateRPCClient(session.getURL()); | ||
BigInteger amount = stateRPCClient.getAddressAmountValue(AssociactionAddress, STCTypeTag); | ||
return this.getTreasuryBalance(STCTypeTag).add(amount); | ||
|
@@ -116,6 +116,6 @@ public BigInteger getSTCTreasurBalance() throws JSONRPC2SessionException { | |
* 获取 STC 的实际供应量 | ||
*/ | ||
public BigInteger getSTCCurrentSupply() throws JSONRPC2SessionException { | ||
return this.getSTCMarketCap().subtract(this.getSTCTreasurBalance()); | ||
return this.getSTCMarketCap().subtract(this.getSTCTreasuryBalance()); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tip
Codebase Verification
Inconsistent Use of JSON Processing Libraries
The codebase contains mixed usage of
com.alibaba.fastjson
andcom.fasterxml.jackson
for JSON processing. To maintain consistency, please ensure that all JSON processing is handled by a single library. The following files still importcom.fasterxml.jackson
:src/main/java/org/starcoin/utils/TransactionPayloadDeserializer.java
src/main/java/org/starcoin/utils/TypeTagDeserializer.java
src/main/java/org/starcoin/utils/TransactionPayloadSerializer.java
src/main/java/org/starcoin/utils/StructTagDeserializer.java
src/main/java/org/starcoin/utils/StructTagSerializer.java
src/main/java/org/starcoin/utils/ScriptFunctionSerializer.java
src/main/java/org/starcoin/utils/ScriptFunctionDeserializer.java
src/main/java/org/starcoin/utils/ParseUtil.java
src/main/java/org/starcoin/utils/ModuleIdSerializer.java
src/main/java/org/starcoin/utils/ModuleDeserializer.java
src/main/java/org/starcoin/utils/TypeTagSerializer.java
src/main/java/org/starcoin/jsonrpc/JSONRPC2Response.java
src/main/java/org/starcoin/jsonrpc/client/JSONRPC2Session.java
src/main/java/org/starcoin/api/StateRPCClient.java
src/main/java/org/starcoin/api/JsonRPCClient.java
src/main/java/org/starcoin/serde/format/jackson/VariantFormatDeserializer.java
src/main/java/org/starcoin/serde/format/jackson/utils/MappingUtils.java
src/main/java/org/starcoin/serde/format/jackson/FormatDeserializer.java
src/main/java/org/starcoin/serde/format/jackson/NamedDeserializer.java
src/main/java/org/starcoin/bean/CustomStringDeserializer.java
src/main/java/org/starcoin/bean/MultiEd25519.java
src/main/java/org/starcoin/bean/ListResource.java
src/main/java/org/starcoin/bean/Authenticator.java
src/main/java/org/starcoin/bean/Event.java
src/main/java/org/starcoin/bean/TransactionInfo.java
src/main/java/org/starcoin/bean/UserTransaction.java
src/main/java/org/starcoin/bean/TransactionInfoWithProof.java
src/main/java/org/starcoin/bean/Kind.java
src/main/java/org/starcoin/bean/Transaction.java
src/main/java/org/starcoin/bean/StateProof.java
src/main/java/org/starcoin/bean/RawTransaction.java
src/main/java/org/starcoin/bean/EventProof.java
src/main/java/org/starcoin/bean/ListResourceOption.java
src/main/java/org/starcoin/bean/TokenInfo.java
src/main/java/org/starcoin/bean/BlockInfo.java
src/main/java/org/starcoin/bean/EventFilter.java
src/main/java/org/starcoin/serde/format/jackson/ContainerFormatDeserializer.java
src/main/java/org/starcoin/bean/BlockHeader.java
src/main/java/org/starcoin/bean/BlockMetadata.java
src/main/java/org/starcoin/bean/Block.java
src/main/java/org/starcoin/bean/BlockGhostdagData.java
src/main/java/org/starcoin/bean/BaseProof.java
src/main/java/org/starcoin/bean/GetEventOption.java
src/main/java/org/starcoin/bean/EventNotificationResult.java
src/main/java/org/starcoin/serde/format/utils/SerdeGenJavaUtils.java
src/main/java/org/starcoin/bean/Resource.java
src/main/java/org/starcoin/serde/format/utils/ReferenceUtils.java
src/main/java/org/starcoin/bean/Ed25519.java
Please update these files to use
com.alibaba.fastjson
or ensure thatcom.fasterxml.jackson
is consistently used across the entire codebase.Analysis chain
Ensure Consistency in JSON Processing Libraries
The new imports for
com.alibaba.fastjson
should be consistently used across the codebase. Verify that all JSON processing is now handled byfastjson
and not mixed with other libraries likeJackson
.Scripts executed
The following scripts were executed for the analysis:
Script:
Length of output: 15778