2424import org .tron .core .db .Manager ;
2525import org .tron .core .exception .ContractValidateException ;
2626import org .tron .core .store .StoreFactory ;
27+ import org .tron .core .vm .EnergyCost ;
2728import org .tron .core .vm .JumpTable ;
2829import org .tron .core .vm .Op ;
2930import org .tron .core .vm .Operation ;
@@ -40,7 +41,7 @@ public class OperationsTest {
4041
4142 private ProgramInvokeMockImpl invoke ;
4243 private Program program ;
43- private final JumpTable jumpTable = OperationRegistry .newTronV10OperationSet ();
44+ private final JumpTable jumpTable = OperationRegistry .getTable ();
4445 private static ChainBaseManager chainBaseManager ;
4546 private static String dbPath ;
4647 private static TronApplicationContext context ;
@@ -862,6 +863,25 @@ public void testComplexOperations() throws ContractValidateException {
862863
863864 }
864865
866+ @ Test
867+ public void testPush0 () throws ContractValidateException {
868+ VMConfig .initAllowTvmShangHai (1 );
869+
870+ invoke = new ProgramInvokeMockImpl ();
871+ Protocol .Transaction trx = Protocol .Transaction .getDefaultInstance ();
872+ InternalTransaction interTrx =
873+ new InternalTransaction (trx , InternalTransaction .TrxType .TRX_UNKNOWN_TYPE );
874+
875+ byte [] op = new byte [1 ];
876+ op [0 ] = Op .PUSH0 ;
877+ program = new Program (op , op , invoke , interTrx );
878+ testOperations (program );
879+ Assert .assertEquals (EnergyCost .getBaseTierCost (null ), program .getResult ().getEnergyUsed ());
880+ Assert .assertEquals (DataWord .ZERO (), program .getStack ().pop ());
881+
882+ VMConfig .initAllowTvmShangHai (0 );
883+ }
884+
865885 private void testOperations (Program program ) {
866886 try {
867887 while (!program .isStopped ()) {
0 commit comments