Skip to content

Commit 505f27d

Browse files
committed
update getOnChainStakedBalance test to return only total staked balance
1 parent 71eada5 commit 505f27d

1 file changed

Lines changed: 3 additions & 10 deletions

File tree

packages/apps/reputation-oracle/server/src/modules/staking/staking.service.spec.ts

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -169,22 +169,17 @@ describe('StakingService', () => {
169169
});
170170

171171
describe('getOnChainStakedBalance', () => {
172-
it('returns total staked and locked balance', async () => {
172+
it('returns total staked balance', async () => {
173173
const address = faker.finance.ethereumAddress();
174174
const stakedAmount = ethers.toBigInt(
175175
faker.number.int({ min: 500, max: 1000000 }),
176176
);
177-
const lockedAmount = ethers.toBigInt(
178-
faker.number.int({ min: 500, max: 999999 }),
179-
);
180177
const mockProvider = {};
181178
mockWeb3Service.getSigner.mockReturnValueOnce({
182179
provider: mockProvider,
183180
} as WalletWithProvider);
184181

185-
const getStakerInfoMock = jest
186-
.fn()
187-
.mockResolvedValue({ stakedAmount, lockedAmount });
182+
const getStakerInfoMock = jest.fn().mockResolvedValue({ stakedAmount });
188183
mockedStakingClient.build.mockResolvedValueOnce({
189184
getStakerInfo: getStakerInfoMock,
190185
} as unknown as StakingClient);
@@ -193,9 +188,7 @@ describe('StakingService', () => {
193188

194189
expect(mockedStakingClient.build).toHaveBeenCalledWith(mockProvider);
195190
expect(getStakerInfoMock).toHaveBeenCalledWith(address);
196-
expect(result).toBe(
197-
Number(ethers.formatEther(stakedAmount + lockedAmount)),
198-
);
191+
expect(result).toBe(Number(ethers.formatEther(stakedAmount)));
199192
});
200193
});
201194

0 commit comments

Comments
 (0)