diff --git a/Libplanet.Action/FeeCollector.cs b/Libplanet.Action/FeeCollector.cs index bd1ce2971f9..ac693db8578 100644 --- a/Libplanet.Action/FeeCollector.cs +++ b/Libplanet.Action/FeeCollector.cs @@ -70,7 +70,7 @@ public IWorld Mortgage(IWorld world) return world; } - IAccount account = world.GetFungibleAssetsAccount(); + IAccount account = world.GetAccount(_context.SystemAccounts.FeeAccount); var balance = account.GetBalance(_context.Signer, realGasPrice.Currency); if (balance < realGasPrice * _context.GasLimit()) { @@ -86,7 +86,7 @@ public IWorld Mortgage(IWorld world) _context.Signer, realGasPrice * _context.GasLimit()); _state = FeeCollectState.Mortgage; - return world.SetFungibleAssetsAccount(nextAccount); + return world.SetAccount(_context.SystemAccounts.FeeAccount, nextAccount); } public IWorld Refund(IWorld world) @@ -108,12 +108,12 @@ public IWorld Refund(IWorld world) return world; } - IAccount nextAccount = world.GetFungibleAssetsAccount().MintAsset( + IAccount nextAccount = world.GetAccount(_context.SystemAccounts.FeeAccount).MintAsset( _context, _context.Signer, (_context.GasLimit() - _context.GasUsed()) * realGasPrice); _state = FeeCollectState.Refund; - return world.SetFungibleAssetsAccount(nextAccount); + return world.SetAccount(_context.SystemAccounts.FeeAccount, nextAccount); } public IWorld Reward(IWorld world) @@ -135,12 +135,12 @@ public IWorld Reward(IWorld world) return world; } - IAccount nextAccount = world.GetFungibleAssetsAccount().MintAsset( + IAccount nextAccount = world.GetAccount(_context.SystemAccounts.FeeAccount).MintAsset( _context, _context.Miner, realGasPrice * _context.GasUsed()); _state = FeeCollectState.Reward; - return world.SetFungibleAssetsAccount(nextAccount); + return world.SetAccount(_context.SystemAccounts.FeeAccount, nextAccount); } public IFeeCollector Next(IActionContext context) diff --git a/Libplanet.Action/State/WorldExtensions.cs b/Libplanet.Action/State/WorldExtensions.cs deleted file mode 100644 index e63d4de27b8..00000000000 --- a/Libplanet.Action/State/WorldExtensions.cs +++ /dev/null @@ -1,20 +0,0 @@ -using System.Collections.Immutable; -using Bencodex.Types; -using Libplanet.Crypto; - -namespace Libplanet.Action.State -{ - internal static class WorldExtensions - { - internal static IAccount GetFungibleAssetsAccount(this IWorldState world) => - world.GetAccount(ReservedAddresses.DefaultAccount); - - internal static IAccount GetValidatorSetAccount(this IWorldState world) => - world.GetAccount(ReservedAddresses.DefaultAccount); - - internal static IWorld SetFungibleAssetsAccount( - this IWorld world, - IAccount account) => - world.SetAccount(ReservedAddresses.DefaultAccount, account); - } -}