Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Show Staked ETH position in mobile homepage along with other tokens #4879

Prev Previous commit
Next Next commit
chore: merge 41.0.0 and update for version
  • Loading branch information
nickewansmith committed Nov 1, 2024
commit bda919b645a1db1ba7f8932f31debb48586729b0
Original file line number Diff line number Diff line change
Expand Up @@ -1278,7 +1278,7 @@ describe('AssetsContractController', () => {
it('should get the staked ethereum balance for an address', async () => {
const { assetsContract, messenger, provider, networkClientConfiguration } =
await setupAssetContractControllers();
assetsContract.configure({ provider });
assetsContract.setProvider(provider);

mockNetworkWithDefaultChainId({
networkClientConfiguration,
Expand Down Expand Up @@ -1340,7 +1340,7 @@ describe('AssetsContractController', () => {
const errorSpy = jest.spyOn(console, 'error');
const { assetsContract, messenger, provider, networkClientConfiguration } =
await setupAssetContractControllers();
assetsContract.configure({ provider });
assetsContract.setProvider(provider);

mockNetworkWithDefaultChainId({
networkClientConfiguration,
Expand Down Expand Up @@ -1387,7 +1387,7 @@ describe('AssetsContractController', () => {
});
const { assetsContract, messenger, provider } =
await setupAssetContractControllers();
assetsContract.configure({ provider });
assetsContract.setProvider(provider);

const balance = await assetsContract.getStakedBalanceForChain(
TEST_ACCOUNT_PUBLIC_ADDRESS,
Expand Down
4 changes: 2 additions & 2 deletions packages/assets-controllers/src/AssetsContractController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -707,8 +707,8 @@ export class AssetsContractController {
address: string,
networkClientId?: NetworkClientId,
): Promise<StakedBalance> {
const chainId = this.getChainId(networkClientId);
const provider = this.getProvider(networkClientId);
const chainId = this.#getCorrectChainId(networkClientId);
const provider = this.#getCorrectProvider(networkClientId);

// balance defaults to zero
let balance: BigNumber = BigNumber.from(0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -905,7 +905,7 @@ describe('AssetsContractController with NetworkClientId', () => {
it('should get the staked ethereum balance for an address', async () => {
const { assetsContract, messenger, provider, networkClientConfiguration } =
await setupAssetContractControllers();
assetsContract.configure({ provider });
assetsContract.setProvider(provider);

mockNetworkWithDefaultChainId({
networkClientConfiguration,
Expand Down Expand Up @@ -966,7 +966,7 @@ describe('AssetsContractController with NetworkClientId', () => {

it('should default staked ethereum balance to undefined if network is not supported', async () => {
const { assetsContract, provider } = await setupAssetContractControllers();
assetsContract.configure({ provider });
assetsContract.setProvider(provider);

const balance = await assetsContract.getStakedBalanceForChain(
TEST_ACCOUNT_PUBLIC_ADDRESS,
Expand Down