Skip to content

Commit f24fd54

Browse files
Add gas limit exceeded test
1 parent 4331a9e commit f24fd54

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

rpc/v8/estimate_fee_test.go

+26
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,32 @@ func TestEstimateFeeWithVM(t *testing.T) {
233233
},
234234
),
235235
},
236+
{
237+
name: "gas limit exceeded",
238+
broadcastedTransactions: []rpc.BroadcastedTransaction{
239+
declareTxn, deployTxn,
240+
createInvokeTransaction(t,
241+
accountAddr, validEntryPoint,
242+
"0x2", deployedContractAddr, "0x64", // 100
243+
),
244+
},
245+
jsonErr: rpccore.ErrTransactionExecutionError.CloneWithData(
246+
rpc.TransactionExecutionErrorData{
247+
TransactionIndex: 2,
248+
ExecutionError: mustMarshal(t, executionError{
249+
ClassHash: accountClassHash.String(),
250+
ContractAddress: accountAddr.String(),
251+
Error: executionError{
252+
ClassHash: accountClassHash.String(),
253+
ContractAddress: accountAddr.String(),
254+
Error: "0x4f7574206f6620676173 ('Out of gas')",
255+
Selector: executeEntryPointSelector,
256+
},
257+
Selector: executeEntryPointSelector,
258+
}),
259+
},
260+
),
261+
},
236262
}
237263

238264
for _, test := range tests {

0 commit comments

Comments
 (0)