Skip to content

Commit

Permalink
fix: provider
Browse files Browse the repository at this point in the history
  • Loading branch information
janek26 committed Jul 15, 2022
1 parent 2c08e5d commit 32f9072
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
1 change: 0 additions & 1 deletion .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ jobs:

env:
TEST_PROVIDER_BASE_URL: http://127.0.0.1:5050/
TEST_RPC_URL: ${{ secrets.TEST_RPC_URL }}
services:
devnet:
image: janek2601/starknet-devnet-patched
Expand Down
4 changes: 2 additions & 2 deletions src/account/default.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ZERO } from '../constants';
import { ProviderOptions } from '../provider';
import { ProviderInterface, ProviderOptions } from '../provider';
import { Provider } from '../provider/default';
import { Signer, SignerInterface } from '../signer';
import {
Expand All @@ -23,7 +23,7 @@ export class Account extends Provider implements AccountInterface {
public signer: SignerInterface;

constructor(
providerOrOptions: ProviderOptions | Provider,
providerOrOptions: ProviderOptions | ProviderInterface,
public address: string,
keyPairOrSigner: KeyPair | SignerInterface
) {
Expand Down
1 change: 1 addition & 0 deletions src/contract/default.ts
Original file line number Diff line number Diff line change
Expand Up @@ -578,6 +578,7 @@ export class Contract implements ContractInterface {
});
}

// eslint-disable-next-line no-console
console.warn(`Invoking ${method} without an account. This will not work on a public node.`);

return this.providerOrAccount.invokeFunction({
Expand Down
4 changes: 4 additions & 0 deletions src/utils/number.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ export function isHex(hex: string): boolean {
}

export function toBN(number: BigNumberish, base?: number | 'hex') {
if (typeof number === 'string') {
// eslint-disable-next-line no-param-reassign
number = number.toLowerCase();
}
if (typeof number === 'string' && isHex(number) && !base)
return new BN(removeHexPrefix(number), 'hex');
return new BN(number, base);
Expand Down

0 comments on commit 32f9072

Please sign in to comment.