@@ -516,7 +516,7 @@ private void createContractImpl(DataWord value, byte[] programCode, byte[] newAd
516
516
TransferActuator .validateForSmartContract (deposit , senderAddress , newAddress , endowment );
517
517
} catch (ContractValidateException e ) {
518
518
// TODO: unreachable exception
519
- throw new BytecodeExecutionException (VALIDATE_FOR_SMART_CONTRACT_FAILURE );
519
+ throw new BytecodeExecutionException (VALIDATE_FOR_SMART_CONTRACT_FAILURE , e . getMessage () );
520
520
}
521
521
deposit .addBalance (senderAddress , -endowment );
522
522
newBalance = deposit .addBalance (newAddress , endowment );
@@ -710,7 +710,7 @@ public void callToAddress(MessageCall msg) {
710
710
refundEnergy (msg .getEnergy ().longValue (), "refund energy from message call" );
711
711
throw new TransferException ("transfer trx failed: %s" , e .getMessage ());
712
712
}
713
- throw new BytecodeExecutionException (VALIDATE_FOR_SMART_CONTRACT_FAILURE );
713
+ throw new BytecodeExecutionException (VALIDATE_FOR_SMART_CONTRACT_FAILURE , e . getMessage () );
714
714
}
715
715
deposit .addBalance (senderAddress , -endowment );
716
716
contextBalance = deposit .addBalance (contextAddress , endowment );
@@ -723,7 +723,7 @@ public void callToAddress(MessageCall msg) {
723
723
refundEnergy (msg .getEnergy ().longValue (), "refund energy from message call" );
724
724
throw new TransferException ("transfer trc10 failed: %s" , e .getMessage ());
725
725
}
726
- throw new BytecodeExecutionException (VALIDATE_FOR_SMART_CONTRACT_FAILURE );
726
+ throw new BytecodeExecutionException (VALIDATE_FOR_SMART_CONTRACT_FAILURE , e . getMessage () );
727
727
}
728
728
deposit .addTokenBalance (senderAddress , tokenId , -endowment );
729
729
deposit .addTokenBalance (contextAddress , tokenId , endowment );
@@ -1414,7 +1414,7 @@ public void callToPrecompiledAddress(MessageCall msg,
1414
1414
&& senderAddress != contextAddress && msg .getEndowment ().value ().longValueExact () > 0 ) {
1415
1415
if (!isTokenTransfer ) {
1416
1416
try {
1417
- transfer (deposit , senderAddress , contextAddress ,
1417
+ tranzsfer (deposit , senderAddress , contextAddress ,
1418
1418
msg .getEndowment ().value ().longValueExact ());
1419
1419
} catch (ContractValidateException e ) {
1420
1420
throw new BytecodeExecutionException ("transfer failure" );
@@ -1424,7 +1424,7 @@ public void callToPrecompiledAddress(MessageCall msg,
1424
1424
TransferAssetActuator
1425
1425
.validateForSmartContract (deposit , senderAddress , contextAddress , tokenId , endowment );
1426
1426
} catch (ContractValidateException e ) {
1427
- throw new BytecodeExecutionException (VALIDATE_FOR_SMART_CONTRACT_FAILURE );
1427
+ throw new BytecodeExecutionException (VALIDATE_FOR_SMART_CONTRACT_FAILURE , e . getMessage () );
1428
1428
}
1429
1429
deposit .addTokenBalance (senderAddress , tokenId , -endowment );
1430
1430
deposit .addTokenBalance (contextAddress , tokenId , endowment );
@@ -1558,6 +1558,10 @@ public static class BytecodeExecutionException extends RuntimeException {
1558
1558
public BytecodeExecutionException (String message ) {
1559
1559
super (message );
1560
1560
}
1561
+
1562
+ public BytecodeExecutionException (String message , Object ... args ) {
1563
+ super (format (message , args ));
1564
+ }
1561
1565
}
1562
1566
1563
1567
public static class TransferException extends BytecodeExecutionException {
0 commit comments