-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: complete refactor factory target addresses
- Loading branch information
1 parent
58b21d9
commit 7fa3885
Showing
11 changed files
with
137 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
package deployer_test | ||
|
||
import ( | ||
"context" | ||
"testing" | ||
|
||
"github.com/0xsequence/ethkit/go-ethereum/common" | ||
"github.com/0xsequence/go-sequence/contracts" | ||
"github.com/0xsequence/go-sequence/deployer" | ||
"github.com/0xsequence/go-sequence/testutil" | ||
"github.com/stretchr/testify/assert" | ||
"github.com/stretchr/testify/require" | ||
) | ||
|
||
func TestEIP2470Deployer(t *testing.T) { | ||
assert.Equal(t, testChain.ChainID().Uint64(), uint64(1337)) | ||
|
||
testWallet := testChain.MustWallet(5) | ||
|
||
eip2470Deployer, err := deployer.NewEIP2470Deployer(testWallet) | ||
require.NoError(t, err) | ||
|
||
// Deploy sequence wallet-contract factory and ensure it equals the expected value in testutil | ||
V1WalletFactoryAddress, err := eip2470Deployer.Deploy(context.Background(), contracts.V1.WalletFactory.ABI, contracts.V1.WalletFactory.Bin, 0, nil, 1000000) | ||
assert.NoError(t, err) | ||
// NOTICE: v1 is deployed w/ the universal deployer, not the EIP2470 deployer | ||
assert.Equal(t, common.HexToAddress("0xf87Cb4C012256149569615642dE44Cf2373efcC9"), V1WalletFactoryAddress) | ||
|
||
testV2SequenceContext := testutil.V2SequenceContext() | ||
|
||
// Deploy sequence wallet-contract factory and ensure it equals the expected value in testutil | ||
V2WalletFactoryAddress, err := eip2470Deployer.Deploy(context.Background(), contracts.V2.WalletFactory.ABI, contracts.V2.WalletFactory.Bin, 0, nil, 1000000) | ||
assert.NoError(t, err) | ||
assert.Equal(t, testV2SequenceContext.FactoryAddress, V2WalletFactoryAddress) | ||
|
||
testV3SequenceContext := testutil.V3SequenceContext() | ||
|
||
// Deploy sequence wallet-contract factory and ensure it equals the expected value in testutil | ||
V3WalletFactoryAddress, err := eip2470Deployer.Deploy(context.Background(), contracts.V3.WalletFactory.ABI, contracts.V3.WalletFactory.Bin, 0, nil, 1000000) | ||
assert.NoError(t, err) | ||
assert.Equal(t, testV3SequenceContext.FactoryAddress, V3WalletFactoryAddress) | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.