Skip to content
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

feat(vm): optimize tests and logs #5900

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public void validate(UnfreezeBalanceV2Param param, Repository repo)

if (!checkUnfreezeBalance(accountCapsule, param.getUnfreezeBalance(), param.getResourceType())) {
throw new ContractValidateException(
"Invalid unfreeze_balance, [" + param.getUnfreezeBalance() + "] is error");
"Invalid unfreeze_balance, [" + param.getUnfreezeBalance() + "] is too large");
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public void staticCallTest() {

@Test
public void correctionTest() {
contract.setConstantCall(false);
contract.setConstantCall(true);
List<Object> signatures = new ArrayList<>();
List<Object> addresses = new ArrayList<>();
byte[] hash = Hash.sha3(longData);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,9 +160,16 @@ public void testCreate2()
// Trigger contract method: deploy(bytes,uint)
long salt = 100L;
String hexInput = AbiUtil.parseMethod(methodSign, Arrays.asList(testCode, salt));
TVMTestResult result = TvmTestUtils
.triggerContractAndReturnTvmTestResult(Hex.decode(OWNER_ADDRESS),
factoryAddress, Hex.decode(hexInput), 0, fee, manager, null);

TVMTestResult result = null;
for (int i = 1; i < 3; i++) {
result = TvmTestUtils
.triggerContractAndReturnTvmTestResult(Hex.decode(OWNER_ADDRESS),
factoryAddress, Hex.decode(hexInput), 0, fee, manager, null);
if (result.getRuntime().getRuntimeError() == null) {
break;
}
}
Assert.assertNull(result.getRuntime().getRuntimeError());

byte[] returnValue = result.getRuntime().getResult().getHReturn();
Expand Down
Loading