Skip to content

Commit

Permalink
fix unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
niuniublockchain committed Jul 28, 2020
1 parent 3be30d7 commit 4e5792c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package org.tron.core.actuator.utils;

import static org.tron.core.capsule.utils.TransactionUtil.isNumber;

import java.io.File;
import java.io.UnsupportedEncodingException;
import lombok.extern.slf4j.Slf4j;
Expand Down Expand Up @@ -132,14 +134,14 @@ public void validTokenAbbrNameCheck() throws UnsupportedEncodingException {
public void isNumberCheck() throws UnsupportedEncodingException {
TransactionUtil actuatorUtil = new TransactionUtil();
String number = "";
Assert.assertEquals(false, actuatorUtil.isNumber(number.getBytes("utf-8")));
Assert.assertEquals(false, isNumber(number.getBytes("utf-8")));

number = "123df34";
Assert.assertEquals(false, actuatorUtil.isNumber(number.getBytes("utf-8")));
Assert.assertEquals(false, isNumber(number.getBytes("utf-8")));
number = "013";
Assert.assertEquals(false, actuatorUtil.isNumber(number.getBytes("utf-8")));
Assert.assertEquals(false, isNumber(number.getBytes("utf-8")));
number = "24";
Assert.assertEquals(true, actuatorUtil.isNumber(number.getBytes("utf-8")));
Assert.assertEquals(true, isNumber(number.getBytes("utf-8")));
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ public class MerkleContainerTest {
public static void init() {
dbManager = context.getBean(Manager.class);
merkleContainer = MerkleContainer
.createInstance(dbManager.getMerkleTreeStore(), dbManager.getMerkleTreeIndexStore());
.createInstance(dbManager.getMerkleTreeStore(), dbManager.getChainBaseManager()
.getMerkleTreeIndexStore());
}

@AfterClass
Expand Down Expand Up @@ -198,7 +199,7 @@ private void initMerkleTreeWitnessInfo() throws ZksnarkException {
PedersenHash a = compressCapsule1.getInstance();
tree.toMerkleTreeContainer().append(a);
dbManager.getMerkleTreeStore().put(tree.toMerkleTreeContainer().getMerkleTreeKey(), tree);
dbManager.getMerkleTreeIndexStore()
dbManager.getChainBaseManager().getMerkleTreeIndexStore()
.put(blockNum, tree.toMerkleTreeContainer().getMerkleTreeKey());
}

Expand Down Expand Up @@ -269,7 +270,7 @@ private void initMerkleTreeWitnessInfo() throws ZksnarkException {
tree.toMerkleTreeContainer().append(b);
dbManager.getMerkleTreeStore().put(tree.toMerkleTreeContainer().getMerkleTreeKey(), tree);

dbManager.getMerkleTreeIndexStore()
dbManager.getChainBaseManager().getMerkleTreeIndexStore()
.put(blockNum, tree.toMerkleTreeContainer().getMerkleTreeKey());
}
//two transaction,the second transaction is the currentTransaction
Expand Down

0 comments on commit 4e5792c

Please sign in to comment.