Remove unused struct field
This commit is contained in:
@@ -53,12 +53,10 @@ interface IStructs {
|
||||
/// Note that these balances may be stale if the current epoch
|
||||
/// is greater than `currentEpoch`.
|
||||
/// Always load this struct using _loadSyncedBalance or _loadUnsyncedBalance.
|
||||
/// @param isInitialized
|
||||
/// @param currentEpoch the current epoch
|
||||
/// @param currentEpochBalance balance in the current epoch.
|
||||
/// @param nextEpochBalance balance in `currentEpoch+1`.
|
||||
struct StoredBalance {
|
||||
bool isInitialized;
|
||||
uint32 currentEpoch;
|
||||
uint96 currentEpochBalance;
|
||||
uint96 nextEpochBalance;
|
||||
|
||||
@@ -177,7 +177,6 @@ contract MixinStakeStorage is
|
||||
{
|
||||
// note - this compresses into a single `sstore` when optimizations are enabled,
|
||||
// since the StakeBalance struct occupies a single word of storage.
|
||||
balancePtr.isInitialized = true;
|
||||
balancePtr.currentEpoch = balance.currentEpoch;
|
||||
balancePtr.nextEpochBalance = balance.nextEpochBalance;
|
||||
balancePtr.currentEpochBalance = balance.currentEpochBalance;
|
||||
|
||||
@@ -117,7 +117,6 @@ contract TestDelegatorRewards is
|
||||
delegator
|
||||
);
|
||||
IStructs.StoredBalance storage _stake = _delegatedStakeToPoolByOwner[delegator][poolId];
|
||||
_stake.isInitialized = true;
|
||||
_stake.currentEpochBalance += uint96(stake);
|
||||
_stake.nextEpochBalance += uint96(stake);
|
||||
_stake.currentEpoch = uint32(currentEpoch);
|
||||
@@ -146,7 +145,6 @@ contract TestDelegatorRewards is
|
||||
if (_stake.currentEpoch < currentEpoch) {
|
||||
_stake.currentEpochBalance = _stake.nextEpochBalance;
|
||||
}
|
||||
_stake.isInitialized = true;
|
||||
_stake.nextEpochBalance += uint96(stake);
|
||||
_stake.currentEpoch = uint32(currentEpoch);
|
||||
}
|
||||
@@ -170,7 +168,6 @@ contract TestDelegatorRewards is
|
||||
if (_stake.currentEpoch < currentEpoch) {
|
||||
_stake.currentEpochBalance = _stake.nextEpochBalance;
|
||||
}
|
||||
_stake.isInitialized = true;
|
||||
_stake.nextEpochBalance -= uint96(stake);
|
||||
_stake.currentEpoch = uint32(currentEpoch);
|
||||
}
|
||||
|
||||
@@ -26,19 +26,16 @@ blockchainTests.resets('MixinStakeStorage unit tests', env => {
|
||||
);
|
||||
await testContract.setCurrentEpoch.awaitTransactionSuccessAsync(CURRENT_EPOCH);
|
||||
defaultUninitializedBalance = {
|
||||
isInitialized: false,
|
||||
currentEpoch: constants.INITIAL_EPOCH,
|
||||
currentEpochBalance: new BigNumber(0),
|
||||
nextEpochBalance: new BigNumber(0),
|
||||
};
|
||||
defaultSyncedBalance = {
|
||||
isInitialized: true,
|
||||
currentEpoch: CURRENT_EPOCH,
|
||||
currentEpochBalance: new BigNumber(16),
|
||||
nextEpochBalance: new BigNumber(16),
|
||||
};
|
||||
defaultUnsyncedBalance = {
|
||||
isInitialized: true,
|
||||
currentEpoch: CURRENT_EPOCH.minus(1),
|
||||
currentEpochBalance: new BigNumber(10),
|
||||
nextEpochBalance: new BigNumber(16),
|
||||
@@ -48,7 +45,6 @@ blockchainTests.resets('MixinStakeStorage unit tests', env => {
|
||||
async function getTestBalancesAsync(index: Numberish): Promise<StoredBalance> {
|
||||
const storedBalance: Partial<StoredBalance> = {};
|
||||
[
|
||||
storedBalance.isInitialized,
|
||||
storedBalance.currentEpoch,
|
||||
storedBalance.currentEpochBalance,
|
||||
storedBalance.nextEpochBalance,
|
||||
|
||||
@@ -59,7 +59,6 @@ export interface EndOfEpochInfo {
|
||||
}
|
||||
|
||||
export interface StoredBalance {
|
||||
isInitialized: boolean;
|
||||
currentEpoch: number | BigNumber;
|
||||
currentEpochBalance: BigNumber;
|
||||
nextEpochBalance: BigNumber;
|
||||
|
||||
Reference in New Issue
Block a user