Skip to content

Commit

Permalink
fix(provider): estimateFee entrypoint conversion fix
Browse files Browse the repository at this point in the history
  • Loading branch information
MilGard91 committed Mar 15, 2022
1 parent b67361a commit e40204a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions src/contract/default.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import {
Result,
StructAbi,
} from '../types';
import { getSelectorFromName } from '../utils/hash';
import { BigNumberish, toBN, toFelt } from '../utils/number';
import { ContractInterface } from './interface';

Expand Down Expand Up @@ -610,7 +609,7 @@ export class Contract implements ContractInterface {
const { inputs } = this.abi.find((abi) => abi.name === method) as FunctionAbi;
return {
contractAddress: this.address,
entrypoint: getSelectorFromName(method),
entrypoint: method,
calldata: this.compileCalldata(args, inputs),
signature: [],
};
Expand Down
2 changes: 1 addition & 1 deletion src/provider/default.ts
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ export class Provider implements ProviderInterface {
public estimateFee(invocation: Invocation): Promise<any> {
return this.fetchEndpoint('estimate_fee', undefined, {
contract_address: invocation.contractAddress,
entry_point_selector: invocation.entrypoint,
entry_point_selector: getSelectorFromName(invocation.entrypoint),
calldata: bigNumberishArrayToDecimalStringArray(invocation.calldata ?? []),
signature: bigNumberishArrayToDecimalStringArray(invocation.signature ?? []),
});
Expand Down

0 comments on commit e40204a

Please sign in to comment.