Skip to content

Commit

Permalink
update 1.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
darylccc committed Sep 14, 2023
2 parents 24ef3d0 + 7a4484c commit 1c76a42
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -2046,8 +2046,15 @@ public synchronized UnfreezeBalanceContract rlpParseToUnfreezeBalanceContract()
build.setReceiverAddress(ByteString.copyFrom(ByteArray.fromHexString(receiverAddress)));
}

if (dataValue.length() >= VALUE_SIZE * 3){ // unfreezeBalance(uint256,address,uint256[])
if (dataValue.length() >= VALUE_SIZE * 3){ // unfreezeBalance(uint256,address,uint256[]) || unfreezeBalance(uint256,address,uint256[],uint256)
int stageIndex = VALUE_SIZE * 3;

int stageArrIndex = ByteUtil.byteArrayToInt(ByteArray.fromHexString(dataValue.substring(VALUE_SIZE * 2, VALUE_SIZE * 3))) * 2;
if (stageArrIndex == VALUE_SIZE * 4) {
build.setUnfreezeBalance(ByteUtil.byteArrayToLong(ByteArray.fromHexString(dataValue.substring(stageIndex, stageIndex + VALUE_SIZE))));
stageIndex += VALUE_SIZE;
}

int stageSize = ByteUtil.byteArrayToInt(ByteArray.fromHexString(dataValue.substring(stageIndex, stageIndex + VALUE_SIZE)));
int index = 1;
int startIndex, endIndex;
Expand Down
3 changes: 3 additions & 0 deletions common/src/main/java/org/vision/core/config/Parameter.java
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,9 @@ public class NativeTransactionContractAbi {
public static final String UnfreezeBalanceStage = "unfreezeBalance(uint256,address,uint256[])"; // b1c68f74 3ec3afdfe31282ab0b2c9362ef7c5c113743ee22ae0697d1207a7c06
public static final String UnfreezeBalanceStage_FunctionSelector = "b1c68f74";

public static final String UnfreezeBalanceStageFragment = "unfreezeBalance(uint256,address,uint256[],uint256)"; // 4d639a82 79345b705fc5a9552f378ef0de3ecdf6163cd6e999898381c0c39942
public static final String UnfreezeBalanceStageFragment_FunctionSelector = "4d639a82";

public static final String WithdrawBalance = "withdrawBalance(uint256)"; // da76d5cd be3baa4ef4f3adb20b7af22c89bcd5dc86bb34ab804e6d35b15874d4
public static final String WithdrawBalance_FunctionSelector = "da76d5cd";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,7 @@ public static Transaction parseEvmTransactionData(TransactionCapsule.EthTrx ethT
break;
case NativeTransactionContractAbi.UnfreezeBalance_FunctionSelector:
case NativeTransactionContractAbi.UnfreezeBalanceStage_FunctionSelector:
case NativeTransactionContractAbi.UnfreezeBalanceStageFragment_FunctionSelector:
UnfreezeBalanceContract.Builder build1 = ethTrx.rlpParseToUnfreezeBalanceContract().toBuilder();
trxCap = wallet.createTransactionCapsule(build1.build(), ContractType.UnfreezeBalanceContract);
break;
Expand Down

0 comments on commit 1c76a42

Please sign in to comment.