@@ -174,6 +174,36 @@ func TestGasUsed_SingleContract_TransferFromChild(t *testing.T) {
174174 assert .Nil (t , err )
175175}
176176
177+ func TestGasUsed_SingleContract_TransferFromChildWithBuiltIn (t * testing.T ) {
178+ testConfig := makeTestConfig ()
179+
180+ _ , err := test .BuildMockInstanceCallTest (t ).
181+ WithContracts (
182+ test .CreateMockContract (test .ParentAddress ).
183+ WithBalance (testConfig .ParentBalance ).
184+ WithCodeMetadata ([]byte {0 , vmcommon .MetadataPayable }).
185+ WithConfig (testConfig ).
186+ WithMethods (contracts .ExecOnDestCtxSingleCallParentMock ),
187+ test .CreateMockContract (test .ChildAddress ).
188+ WithBalance (testConfig .ChildBalance ).
189+ WithConfig (testConfig ).
190+ WithMethods (contracts .TransferAndExecuteWithBuiltIn )).
191+ WithInput (test .CreateTestContractCallInputBuilder ().
192+ WithRecipientAddr (test .ParentAddress ).
193+ WithGasProvided (testConfig .GasProvided ).
194+ WithFunction ("execOnDestCtxSingleCall" ).
195+ WithArguments (test .ChildAddress , []byte ("transferAndExecuteWithBuiltIn" )).
196+ Build ()).
197+ WithSetup (func (host vmhost.VMHost , world * worldmock.MockWorld ) {
198+ createMockBuiltinFunctions (t , host , world )
199+ setZeroCodeCosts (host )
200+ }).
201+ AndAssertResults (func (world * worldmock.MockWorld , verify * test.VMOutputVerifier ) {
202+ verify .ReturnCode (vmcommon .ExecutionFailed )
203+ })
204+ assert .Nil (t , err )
205+ }
206+
177207func TestGasUsed_ExecuteOnDestChain (t * testing.T ) {
178208 alphaAddress := test .MakeTestSCAddress ("alpha" )
179209 betaAddress := test .MakeTestSCAddress ("beta" )
0 commit comments