File tree Expand file tree Collapse file tree 3 files changed +7
-1
lines changed Expand file tree Collapse file tree 3 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -48,13 +48,15 @@ describe('RPCProvider', () => {
4848 } ) ;
4949
5050 test ( 'estimate fee' , async ( ) => {
51- const { overall_fee } = await account . estimateFee ( {
51+ const { overall_fee, gas_consumed , gas_price } = await account . estimateFee ( {
5252 contractAddress : erc20Address ,
5353 entrypoint : 'transfer' ,
5454 calldata : [ erc20 . address , '10' ] ,
5555 } ) ;
5656
5757 expect ( isBN ( overall_fee ) ) . toBe ( true ) ;
58+ expect ( isBN ( gas_consumed ) ) . toBe ( true ) ;
59+ expect ( isBN ( gas_price ) ) . toBe ( true ) ;
5860 } ) ;
5961
6062 test ( 'execute by wallet owner' , async ( ) => {
Original file line number Diff line number Diff line change @@ -83,6 +83,8 @@ export type DeclareTransactionReceiptResponse = CommonTransactionReceiptResponse
8383
8484export interface EstimateFeeResponse {
8585 overall_fee : BigNumberish ;
86+ gas_consumed ?: BigNumberish ;
87+ gas_price ?: BigNumberish ;
8688}
8789
8890export interface InvokeFunctionResponse {
Original file line number Diff line number Diff line change @@ -70,6 +70,8 @@ export class RPCResponseParser extends ResponseParser {
7070 public parseFeeEstimateResponse ( res : RPC . EstimateFeeResponse ) : EstimateFeeResponse {
7171 return {
7272 overall_fee : toBN ( res . overall_fee ) ,
73+ gas_consumed : toBN ( res . gas_consumed ) ,
74+ gas_price : toBN ( res . gas_price ) ,
7375 } ;
7476 }
7577
You can’t perform that action at this time.
0 commit comments