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

Update names for consistency #42

Merged
merged 1 commit into from
Sep 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions lib/api/puffer-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ import { ERC20PermitHandler } from '../contracts/handlers/erc20-permit-handler';
import { PufLockerHandler } from '../contracts/handlers/puf-locker-handler';
import { L2RewardManagerHandler } from '../contracts/handlers/l2-reward-manager-handler';
import { L1RewardManagerHandler } from '../contracts/handlers/l1-reward-manager-handler';
import { PufferWithdrawalHandler } from '../contracts/handlers/puffer-withdrawal-manager';

import { PufferWithdrawalManagerHandler } from '../contracts/handlers/puffer-withdrawal-manager-handler';
/**
* The core class and the main entry point of the Puffer SDK.
*/
Expand All @@ -41,7 +40,7 @@ export class PufferClient {
/** Handler for the `L1RewardManager` contract. */
public l1RewardManager: L1RewardManagerHandler;
/** Handler for the `PufferWithdrawalManager` contract. */
public pufferWithdrawalManager: PufferWithdrawalHandler;
public pufferWithdrawalManager: PufferWithdrawalManagerHandler;

/**
* Create the Puffer Client.
Expand Down Expand Up @@ -113,7 +112,7 @@ export class PufferClient {
this.walletClient,
this.publicClient,
);
this.pufferWithdrawalManager = new PufferWithdrawalHandler(
this.pufferWithdrawalManager = new PufferWithdrawalManagerHandler(
chain,
this.walletClient,
this.publicClient,
Expand Down
3 changes: 3 additions & 0 deletions lib/contracts/addresses.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export const CONTRACT_ADDRESSES = {
PufferDepositor: '0x4aa799c5dfc01ee7d790e3bf1a7c2257ce1dceff',
PufferL2Depositor: '0x3436E0B85cd929929F5802e792CFE282166E0259',
PufLocker: '0x48e8dE138C246c14248C94d2D616a2F9eb4590D2',
PufferWithdrawalManager: '0x8a253974f1de9f64d79f1eaaf850faf406802fce',
L2RewardManager: '0xb4dBcf934558d7b647A7FB21bbcd6b8370318A5c',
L1RewardManager: '0x5A0B37ce6c5b90B634B2AD32E3d909B545De8BB7',
},
Expand All @@ -16,6 +17,8 @@ export const CONTRACT_ADDRESSES = {
PufferDepositor: '0x824AC05aeb86A0aD770b8acDe0906d2d4a6c4A8c',
PufferL2Depositor: '0x0af6998e4828ad8ef8f79a9288d0a861890f791d',
PufLocker: '0xa58983ad0899a452b7420bc57228e329d7ba92b6',
// These are deployed on a fork at the moment:
// https://rpc.tenderly.co/fork/f7fd7621-7280-47e5-8521-81b24142814f
L1RewardManager: '0x10f970bcb84B82B82a65eBCbF45F26dD26D69F12',
L2RewardManager: '0x58C046794f69A8830b0BE737022a45b4acd01dE5',
// This is deployed on a fork at the moment:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
import { Address, getContract } from 'viem';
import { PufferWithdrawalHandler } from './puffer-withdrawal-manager';
import { PufferWithdrawalManagerHandler } from './puffer-withdrawal-manager-handler';
import {
setupTestPublicClient,
setupTestWalletClient,
} from '../../../test/setup-test-clients';
import { Chain } from '../../chains/constants';
import { PUFFER_WITHDRAWAL_MANAGER_ABIS } from '../abis/puffer-withdrawal-manager-abis';
import { CONTRACT_ADDRESSES } from '../addresses';
import { Address, getContract } from 'viem';

jest.mock('viem', () => ({
...jest.requireActual('viem'),
getContract: jest.fn(),
}));

describe('PufferWithdrawalHandler', () => {
let handler: PufferWithdrawalHandler;
describe('PufferWithdrawalMangerHandler', () => {
let handler: PufferWithdrawalManagerHandler;
const mockChain = Chain.Holesky;
const mockAddress = '0x123' as Address;
const walletClient = setupTestWalletClient();
const publicClient = setupTestPublicClient();

beforeEach(() => {
handler = new PufferWithdrawalHandler(
handler = new PufferWithdrawalManagerHandler(
mockChain,
walletClient,
publicClient,
Expand Down Expand Up @@ -181,7 +181,7 @@ describe('PufferWithdrawalHandler', () => {
});

const withdrawalIdx = BigInt(5);
const { transact } = await handler.completeQueueWithdrawal(
const { transact } = await handler.completeQueuedWithdrawal(
mockAddress,
withdrawalIdx,
);
Expand All @@ -204,7 +204,7 @@ describe('PufferWithdrawalHandler', () => {
});

const withdrawalIdx = BigInt(5);
const { estimate } = await handler.completeQueueWithdrawal(
const { estimate } = await handler.completeQueuedWithdrawal(
mockAddress,
withdrawalIdx,
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { Token } from '../tokens';
* Handler for the `PufferWithdrawalsManager` contract exposing methods to
* interact with the contract.
*/
export class PufferWithdrawalHandler {
export class PufferWithdrawalManagerHandler {
private viemChain: ViemChain;
private erc20PermitHandler: ERC20PermitHandler;

Expand Down Expand Up @@ -139,7 +139,7 @@ export class PufferWithdrawalHandler {
* @param withdrawalIdx The index of the withdrawal to complete.
* @returns The transaction hash of the withdrawal.
*/
public async completeQueueWithdrawal(
public async completeQueuedWithdrawal(
walletAddress: Address,
withdrawalIdx: bigint,
) {
Expand Down
1 change: 1 addition & 0 deletions lib/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ export * from './contracts/handlers/puf-token-handler';
export * from './contracts/handlers/puffer-depositor-handler';
export * from './contracts/handlers/puffer-l2-depositor-handler';
export * from './contracts/handlers/puffer-vault-handler';
export * from './contracts/handlers/puffer-withdrawal-manager-handler';
Loading