Skip to content

Commit

Permalink
fix: naming for l2 unwrap
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeday committed Oct 3, 2024
1 parent 56ec2cf commit ce61494
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
9 changes: 6 additions & 3 deletions packages/sdk/src/l2/__test__/l2.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ describe('LidoSDKL2 wrap', () => {
const stethAddress = l2.core.getL2ContractAddress(
LIDO_L2_CONTRACT_NAMES.steth,
);
const tx = await l2.unwrapPopulateTx({ value });
const tx = await l2.unwrapStethPopulateTx({ value });
expectAddress(tx.to, stethAddress);
expectAddress(tx.from, account.address);
expectPopulatedTx(tx, undefined);
Expand All @@ -188,7 +188,7 @@ describe('LidoSDKL2 wrap', () => {
const stethAddress = l2.core.getL2ContractAddress(
LIDO_L2_CONTRACT_NAMES.steth,
);
const tx = await l2.unwrapSimulateTx({ value });
const tx = await l2.unwrapStethSimulateTx({ value });
expectAddress(tx.address, stethAddress);
});

Expand All @@ -197,7 +197,10 @@ describe('LidoSDKL2 wrap', () => {
const stethBalanceBefore = await l2.steth.balance(account.address);
const wstethBalanceBefore = await l2.wsteth.balance(account.address);
const mock = jest.fn();
const tx = await l2.unwrap({ value: stethValue, callback: mock });
const tx = await l2.unwrapStethToWsteth({
value: stethValue,
callback: mock,
});
expectTxCallback(mock, tx);
const stethBalanceAfter = await l2.steth.balance(account.address);
const wstethBalanceAfter = await l2.wsteth.balance(account.address);
Expand Down
6 changes: 3 additions & 3 deletions packages/sdk/src/l2/l2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ export class LidoSDKL2 extends LidoSDKModule {

@Logger('Call:')
@ErrorHandler()
public async unwrap(
public async unwrapStethToWsteth(
props: WrapProps,
): Promise<TransactionResult<UnwrapResults>> {
this.core.useWeb3Provider();
Expand All @@ -219,7 +219,7 @@ export class LidoSDKL2 extends LidoSDKModule {

@Logger('Utils:')
@ErrorHandler()
public async unwrapPopulateTx(
public async unwrapStethPopulateTx(
props: Omit<WrapProps, 'callback'>,
): Promise<PopulatedTransaction> {
const { value, account } = await this.parseProps(props);
Expand All @@ -238,7 +238,7 @@ export class LidoSDKL2 extends LidoSDKModule {

@Logger('Call:')
@ErrorHandler()
public async unwrapSimulateTx(
public async unwrapStethSimulateTx(
props: Omit<WrapProps, 'callback'>,
): Promise<WriteContractParameters> {
const { value, account } = await this.parseProps(props);
Expand Down

0 comments on commit ce61494

Please sign in to comment.