@@ -8,7 +8,6 @@ let hubPool: Contract, spokePool: Contract, weth: Contract, usdc: Contract;
8
8
let owner : SignerWithAddress ;
9
9
let cctpTokenMessenger : FakeContract ;
10
10
11
- // ABI for CCTP Token Messenger
12
11
const tokenMessengerAbi = [
13
12
{
14
13
inputs : [ ] ,
@@ -25,12 +24,10 @@ describe("Base Spoke Pool", function () {
25
24
( { weth, usdc, hubPool } = await hubPoolFixture ( ) ) ;
26
25
27
26
cctpTokenMessenger = await smock . fake ( tokenMessengerAbi ) ;
28
- cctpTokenMessenger . localToken . returns ( usdc . address ) ;
29
27
30
- // Deploy Base SpokePool
31
28
spokePool = await hre . upgrades . deployProxy (
32
29
await getContractFactory ( "Base_SpokePool" , owner ) ,
33
- [ 0 , hubPool . address , hubPool . address ] ,
30
+ [ 0 , owner . address , hubPool . address ] ,
34
31
{
35
32
kind : "uups" ,
36
33
unsafeAllow : [ "delegatecall" ] ,
@@ -40,21 +37,26 @@ describe("Base Spoke Pool", function () {
40
37
} ) ;
41
38
42
39
describe ( "Initialization" , function ( ) {
43
- it ( "Should initialize with correct parameters" , async function ( ) {
44
- expect ( await spokePool . _l2Usdc ) . to . equal ( usdc . address ) ;
40
+ it ( "Should initialize with correct constructor parameters" , async function ( ) {
41
+ expect ( await spokePool . wrappedNativeToken ( ) ) . to . equal ( weth . address ) ;
42
+ expect ( await spokePool . usdcToken ( ) ) . to . equal ( usdc . address ) ;
45
43
expect ( await spokePool . cctpTokenMessenger ( ) ) . to . equal ( cctpTokenMessenger . address ) ;
46
44
} ) ;
47
45
48
- it ( "Should start with deposit ID 0 " , async function ( ) {
46
+ it ( "Should initialize with correct proxy parameters " , async function ( ) {
49
47
expect ( await spokePool . numberOfDeposits ( ) ) . to . equal ( 0 ) ;
48
+ expect ( await spokePool . crossDomainAdmin ( ) ) . to . equal ( owner . address ) ;
49
+ expect ( await spokePool . withdrawalRecipient ( ) ) . to . equal ( hubPool . address ) ;
50
+ } ) ;
51
+
52
+ it ( "Should initialize with correct OVM_ETH" , async function ( ) {
53
+ expect ( await spokePool . l2Eth ( ) ) . to . equal ( "0xDeadDeAddeAddEAddeadDEaDDEAdDeaDDeAD0000" ) ;
50
54
} ) ;
51
55
} ) ;
52
56
53
57
describe ( "Error cases" , function ( ) {
54
- it ( "Should revert if trying to initialize twice" , async function ( ) {
55
- await expect ( spokePool . initialize ( 0 , hubPool . address , hubPool . address ) ) . to . be . revertedWith (
56
- "Initializable: contract is already initialized"
57
- ) ;
58
+ it ( "Should revert on reinitialization" , async function ( ) {
59
+ await expect ( spokePool . connect ( owner ) . initialize ( 0 , owner . address , hubPool . address ) ) . to . be . reverted ;
58
60
} ) ;
59
61
} ) ;
60
62
} ) ;
0 commit comments