Minor improve:
+ ProgramPlayDialog rollback changes + DataWord all zeroes care
This commit is contained in:
parent
63c9405c19
commit
ea3372c4f5
|
@ -357,7 +357,7 @@ class ContractCallDialog extends JDialog implements MessageAwareDialog{
|
|||
WorldManager.instance.detaildDB.get(contractAddress);
|
||||
|
||||
ContractDetails contractDetails = null;
|
||||
if (contractDetailsB.length > 0)
|
||||
if (contractDetailsB != null && contractDetailsB.length > 0)
|
||||
contractDetails = new ContractDetails(contractDetailsB);
|
||||
|
||||
Transaction tx = createTransaction();
|
||||
|
|
|
@ -51,13 +51,14 @@ public class ProgramPlayDialog extends JPanel implements ActionListener,
|
|||
ProgramInvokeFactory.createProgramInvoke(tx, lastBlock, contractDetails,
|
||||
trackDetailDB, trackChainDb, trackStateDB));
|
||||
|
||||
program.addListener(this);
|
||||
program.fullTrace();
|
||||
vm.play(program);
|
||||
|
||||
trackDetailDB.rollbackTrack();
|
||||
trackChainDb.rollbackTrack();
|
||||
trackStateDB.rollbackTrack();
|
||||
|
||||
program.addListener(this);
|
||||
program.fullTrace();
|
||||
vm.play(program);
|
||||
|
||||
setLayout(new BoxLayout(this, BoxLayout.PAGE_AXIS));
|
||||
|
||||
|
|
|
@ -160,12 +160,14 @@ public class ByteUtil {
|
|||
if (data == null) return null;
|
||||
|
||||
int firstNonZero = 0;
|
||||
for (int i = 0; i < data.length; ++i)
|
||||
int i = 0;
|
||||
for (i = 0; i < data.length; ++i)
|
||||
if (data[i] != 0){
|
||||
firstNonZero = i;
|
||||
break;
|
||||
}
|
||||
|
||||
if (i == data.length) return new byte[1];
|
||||
if (firstNonZero == 0) return data;
|
||||
|
||||
byte[] result = new byte[data.length - firstNonZero];
|
||||
|
|
Loading…
Reference in New Issue