Skip to content

Commit

Permalink
chore: rename assetMan to assetMgr
Browse files Browse the repository at this point in the history
  • Loading branch information
seolaoh committed May 30, 2024
1 parent 0955d54 commit 561e944
Show file tree
Hide file tree
Showing 5 changed files with 63 additions and 63 deletions.
10 changes: 5 additions & 5 deletions op-e2e/actions/l2_challenger_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ interaction:
require.NoError(rt.t, err)
require.Equal(rt.t, val.StatusRegistered, valStatus)

afterAsset, err := rt.assetManContract.TotalKroAssets(nil, rt.validator.address)
afterAsset, err := rt.assetMgrContract.TotalKroAssets(nil, rt.validator.address)
require.NoError(rt.t, err)
require.Equal(rt.t, beforeAsset.Uint64()-slashingAmount.Uint64(), afterAsset.Uint64())

Expand Down Expand Up @@ -243,7 +243,7 @@ interaction:
require.NoError(rt.t, err)
require.Equal(rt.t, val.StatusRegistered, valStatus)

afterAsset, err := rt.assetManContract.TotalKroAssets(nil, rt.validator.address)
afterAsset, err := rt.assetMgrContract.TotalKroAssets(nil, rt.validator.address)
require.NoError(rt.t, err)
require.Equal(rt.t, beforeAsset.Uint64()-slashingAmount.Uint64(), afterAsset.Uint64())

Expand Down Expand Up @@ -337,7 +337,7 @@ interaction:
require.NoError(rt.t, err)
require.Equal(rt.t, val.StatusRegistered, valStatus)

afterAsset, err := rt.assetManContract.TotalKroAssets(nil, rt.challenger1.address)
afterAsset, err := rt.assetMgrContract.TotalKroAssets(nil, rt.challenger1.address)
require.NoError(rt.t, err)
require.Equal(rt.t, beforeAsset.Uint64()-slashingAmount.Uint64(), afterAsset.Uint64())

Expand Down Expand Up @@ -435,7 +435,7 @@ interaction:
require.NoError(rt.t, err)
require.Equal(rt.t, val.StatusRegistered, valStatus)

afterAsset, err := rt.assetManContract.TotalKroAssets(nil, rt.challenger1.address)
afterAsset, err := rt.assetMgrContract.TotalKroAssets(nil, rt.challenger1.address)
require.NoError(rt.t, err)
require.Equal(rt.t, beforeAsset.Uint64()-slashingAmount.Uint64(), afterAsset.Uint64())

Expand Down Expand Up @@ -659,7 +659,7 @@ interaction:
require.NoError(rt.t, err)
require.True(rt.t, inJail)

afterAsset, err := rt.assetManContract.TotalKroAssets(nil, rt.validator.address)
afterAsset, err := rt.assetMgrContract.TotalKroAssets(nil, rt.validator.address)
require.NoError(rt.t, err)
require.Equal(rt.t, beforeAsset.Uint64()-slashingAmount.Uint64(), afterAsset.Uint64())

Expand Down
18 changes: 9 additions & 9 deletions op-e2e/actions/l2_runtime.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ type Runtime struct {
securityCouncilContract *bindings.SecurityCouncil
valPoolContract *bindings.ValidatorPoolCaller
valMgrContract *bindings.ValidatorManagerCaller
assetManContract *bindings.AssetManagerCaller
assetMgrContract *bindings.AssetManagerCaller
assetTokenContract *bindings.GovernanceTokenCaller
targetInvalidBlockNumber uint64
outputIndex *big.Int
Expand Down Expand Up @@ -175,10 +175,10 @@ func (rt *Runtime) bindContracts() {
rt.valMgrContract, err = bindings.NewValidatorManagerCaller(rt.sd.DeploymentsL1.ValidatorManagerProxy, rt.miner.EthClient())
require.NoError(rt.t, err)

rt.assetManContract, err = bindings.NewAssetManagerCaller(rt.sd.DeploymentsL1.AssetManagerProxy, rt.miner.EthClient())
rt.assetMgrContract, err = bindings.NewAssetManagerCaller(rt.sd.DeploymentsL1.AssetManagerProxy, rt.miner.EthClient())
require.NoError(rt.t, err)

assetTokenAddr, err := rt.assetManContract.ASSETTOKEN(nil)
assetTokenAddr, err := rt.assetMgrContract.ASSETTOKEN(nil)
require.NoError(rt.t, err)
rt.assetTokenContract, err = bindings.NewGovernanceTokenCaller(assetTokenAddr, rt.miner.EthClient())
require.NoError(rt.t, err)
Expand Down Expand Up @@ -355,17 +355,17 @@ func (rt *Runtime) submitL2Output() {
}

func (rt *Runtime) fetchChallengeAssets(loser common.Address) (*big.Int, *big.Int, *big.Int) {
slashingRate, err := rt.assetManContract.SLASHINGRATE(nil)
slashingRate, err := rt.assetMgrContract.SLASHINGRATE(nil)
require.NoError(rt.t, err)
slashingRateDenom, err := rt.assetManContract.SLASHINGRATEDENOM(nil)
slashingRateDenom, err := rt.assetMgrContract.SLASHINGRATEDENOM(nil)
require.NoError(rt.t, err)
taxRate, err := rt.assetManContract.TAXNUMERATOR(nil)
taxRate, err := rt.assetMgrContract.TAXNUMERATOR(nil)
require.NoError(rt.t, err)
taxDenom, err := rt.assetManContract.TAXDENOMINATOR(nil)
taxDenom, err := rt.assetMgrContract.TAXDENOMINATOR(nil)
require.NoError(rt.t, err)
minSlashingAmount, err := rt.assetManContract.MINSLASHINGAMOUNT(nil)
minSlashingAmount, err := rt.assetMgrContract.MINSLASHINGAMOUNT(nil)
require.NoError(rt.t, err)
totalAsset, err := rt.assetManContract.TotalKroAssets(nil, loser)
totalAsset, err := rt.assetMgrContract.TotalKroAssets(nil, loser)
require.NoError(rt.t, err)

slashingAmount := new(big.Int).Div(new(big.Int).Mul(totalAsset, slashingRate), slashingRateDenom)
Expand Down
2 changes: 1 addition & 1 deletion packages/contracts/contracts/test/AssetManager.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ contract AssetManagerTest is ValidatorSystemUpgrade_Initializer {
minSlashingAmount
);

address assetManagerAddr = address(assetMan);
address assetManagerAddr = address(assetMgr);

vm.prank(multisig);
Proxy(payable(assetManagerAddr)).upgradeTo(address(assetManagerImpl));
Expand Down
12 changes: 6 additions & 6 deletions packages/contracts/contracts/test/CommonTest.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ contract L2OutputOracle_Initializer is UpgradeGovernor_Initializer {
// Test target
ValidatorPool pool;
ValidatorPool poolImpl;
AssetManager assetMan;
AssetManager assetMgr;
AssetManager assetManImpl;
ValidatorManager valMgr;
ValidatorManager valMgrImpl;
Expand Down Expand Up @@ -291,8 +291,8 @@ contract L2OutputOracle_Initializer is UpgradeGovernor_Initializer {
// Deploy proxies
pool = ValidatorPool(address(new Proxy(multisig)));
vm.label(address(pool), "ValidatorPool");
assetMan = AssetManager(address(new Proxy(multisig)));
vm.label(address(assetMan), "AssetManager");
assetMgr = AssetManager(address(new Proxy(multisig)));
vm.label(address(assetMgr), "AssetManager");
valMgr = ValidatorManager(address(new Proxy(multisig)));
vm.label(address(valMgr), "ValidatorManager");
oracle = L2OutputOracle(address(new Proxy(multisig)));
Expand Down Expand Up @@ -347,7 +347,7 @@ contract L2OutputOracle_Initializer is UpgradeGovernor_Initializer {
// Deploy the ValidatorManager
constructorParams = IValidatorManager.ConstructorParams({
_l2Oracle: oracle,
_assetManager: assetMan,
_assetManager: assetMgr,
_trustedValidator: trusted,
_commissionRateMinChangeSeconds: commissionRateMinChangeSeconds,
_roundDurationSeconds: uint128(roundDuration),
Expand Down Expand Up @@ -384,7 +384,7 @@ contract L2OutputOracle_Initializer is UpgradeGovernor_Initializer {
);

vm.prank(multisig);
Proxy(payable(address(assetMan))).upgradeTo(address(assetManImpl));
Proxy(payable(address(assetMgr))).upgradeTo(address(assetManImpl));

vm.prank(multisig);
Proxy(payable(address(valMgr))).upgradeTo(address(valMgrImpl));
Expand All @@ -403,7 +403,7 @@ contract L2OutputOracle_Initializer is UpgradeGovernor_Initializer {

function _registerValidator(address validator, uint128 assets) internal {
vm.startPrank(validator);
assetToken.approve(address(assetMan), uint256(assets));
assetToken.approve(address(assetMgr), uint256(assets));
valMgr.registerValidator(assets, 10, 5);
vm.stopPrank();
}
Expand Down
Loading

0 comments on commit 561e944

Please sign in to comment.