-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
test(db): add test for db #5463
test(db): add test for db #5463
Conversation
private static final byte[] ASSET_KEY = "20000".getBytes(); | ||
private static AccountCapsule ownerCapsule; | ||
|
||
private static String OWNER_ADDRESS = Wallet.getAddressPreFixString() |
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.
Use static final?
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.
It's not necessary, and not using final doesn't hurt.
|
||
|
||
private long createAsset(String tokenName) { | ||
long id = chainBaseManager.getDynamicPropertiesStore().getTokenIdNum() + 1; |
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.
Will this be conflict in any two test cases?
AssetIssueContractOuterClass.AssetIssueContract.newBuilder() | ||
.setName(ByteString.copyFrom(firstTokenId.getBytes())) | ||
.build()); | ||
assetIssueCapsule.setId(String.valueOf(2L)); |
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.
Should this not be the same as the token "efg"?
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.
efg is the test data in testPut, and as this is a deleted test case, it makes sense not to use the same data
|
||
private SmartContractOuterClass.SmartContract.Builder createContract( | ||
String contractAddress, String contractName) { | ||
OWNER_ADDRESS = |
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.
Why not return the contract?
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.
There is no need to return contract, it is a static variable.
What does this PR do?
add several test cases to cover more code verification scenarios
Why are these changes required?
to improve test case coverage
This PR has been tested by:
Follow up
Extra details