diff --git a/.gitignore b/.gitignore index 44bc97aeb..362ef3741 100644 --- a/.gitignore +++ b/.gitignore @@ -21,3 +21,5 @@ cypress/plugins # Yarn node_modules/ yarn-error.log + +.cosine/ \ No newline at end of file diff --git a/src/store/staking-applications/effects.ts b/src/store/staking-applications/effects.ts index a37840f95..8c9a52341 100644 --- a/src/store/staking-applications/effects.ts +++ b/src/store/staking-applications/effects.ts @@ -148,7 +148,7 @@ const getKeepStakingAppStakingProvidersData = async ( _appData.pendingAuthorizationDecrease.toString(), remainingAuthorizationDecreaseDelay: _appData.remainingAuthorizationDecreaseDelay.toString(), - isDeauthorizationReqestActive: _appData.isDeauthorizationReqestActive, + isDeauthorizationRequestActive: _appData.isDeauthorizationRequestActive, deauthorizationCreatedAt: _appData.deauthorizationCreatedAt?.toString(), } diff --git a/src/store/staking-applications/selectors.ts b/src/store/staking-applications/selectors.ts index 964ffd731..9a7191d44 100644 --- a/src/store/staking-applications/selectors.ts +++ b/src/store/staking-applications/selectors.ts @@ -51,7 +51,7 @@ export const selectStakingAppByStakingProvider = createSelector( status = "authorized" } else if ( hasPendingDeauthorization && - !authData?.isDeauthorizationReqestActive && + !authData?.isDeauthorizationRequestActive && authData.isOperatorInPool !== undefined && !authData.isOperatorInPool ) { diff --git a/src/store/staking-applications/slice.ts b/src/store/staking-applications/slice.ts index a7aa48883..27a3b0ec2 100644 --- a/src/store/staking-applications/slice.ts +++ b/src/store/staking-applications/slice.ts @@ -215,14 +215,14 @@ export const stakingApplicationsSlice = createSlice({ // was in the sortition pool. Before authorization decrease delay // starts, the operator needs to update the state of the sortition pool // with a call to `joinSortitionPool` or `updateOperatorStatus`. - const isDeauthorizationReqestActive = + const isDeauthorizationRequestActive = !BigNumber.from(decreasingAt).eq(MAX_UINT64) state[appName].stakingProviders.data[stakingProvider] = { ...stakingProviderData, - isDeauthorizationReqestActive, + isDeauthorizationRequestActive, pendingAuthorizationDecrease: decreaseAmount, - remainingAuthorizationDecreaseDelay: isDeauthorizationReqestActive + remainingAuthorizationDecreaseDelay: isDeauthorizationRequestActive ? "0" : MAX_UINT64.toString(), deauthorizationCreatedAt: undefined, @@ -243,7 +243,7 @@ export const stakingApplicationsSlice = createSlice({ if (!stakingProviderData) return const deauthorizationCreatedAt = - !stakingProviderData.isDeauthorizationReqestActive + !stakingProviderData.isDeauthorizationRequestActive ? dateToUnixTimestamp().toString() : stakingProviderData.deauthorizationCreatedAt @@ -251,7 +251,7 @@ export const stakingApplicationsSlice = createSlice({ ...stakingProviderData, remainingAuthorizationDecreaseDelay: state[appName].parameters.data.authorizationDecreaseDelay, - isDeauthorizationReqestActive: true, + isDeauthorizationRequestActive: true, deauthorizationCreatedAt, } }, @@ -266,7 +266,7 @@ export const stakingApplicationsSlice = createSlice({ authorizedStake: "0", pendingAuthorizationDecrease: "0", remainingAuthorizationDecreaseDelay: "0", - isDeauthorizationReqestActive: false, + isDeauthorizationRequestActive: false, deauthorizationCreatedAt: undefined, isOperatorInPool: undefined, operator: AddressZero, diff --git a/src/threshold-ts/applications/__tests__/application.test.ts b/src/threshold-ts/applications/__tests__/application.test.ts index 972ac4d1d..02701f9ed 100644 --- a/src/threshold-ts/applications/__tests__/application.test.ts +++ b/src/threshold-ts/applications/__tests__/application.test.ts @@ -206,7 +206,7 @@ describe("Application test", () => { { remainingAuthorizationDecreaseDelay: MAX_UINT64, expectedValue: { - isDeauthorizationReqestActive: false, + isDeauthorizationRequestActive: false, deauthorizationCreatedAt: undefined, }, testMessage: @@ -215,7 +215,7 @@ describe("Application test", () => { { remainingAuthorizationDecreaseDelay: 0, expectedValue: { - isDeauthorizationReqestActive: true, + isDeauthorizationRequestActive: true, deauthorizationCreatedAt: undefined, }, testMessage: @@ -224,7 +224,7 @@ describe("Application test", () => { { remainingAuthorizationDecreaseDelay, expectedValue: { - isDeauthorizationReqestActive: true, + isDeauthorizationRequestActive: true, deauthorizationCreatedAt: BigNumber.from(createdAt), }, testMessage: diff --git a/src/threshold-ts/applications/index.ts b/src/threshold-ts/applications/index.ts index 4737a88d9..c1351f960 100644 --- a/src/threshold-ts/applications/index.ts +++ b/src/threshold-ts/applications/index.ts @@ -59,7 +59,7 @@ export interface StakingProviderAppInfo< * call `joinSortitionPool` or `updateOperatorStatus` to activate the request. * In that case we can't estimate when the deauthorization request started. */ - isDeauthorizationReqestActive: boolean + isDeauthorizationRequestActive: boolean /** * Timestamp when the deauthorization request was created.Takes an undefined * value if it cannot be estimated @@ -321,21 +321,21 @@ export class Application implements IApplication { remainingAuthorizationDecreaseDelay.toString() ) - let isDeauthorizationReqestActive = true + let isDeauthorizationRequestActive = true if (_remainingAuthorizationDecreaseDelay.eq(MAX_UINT64)) { // If a `remainingAuthorizationDecreaseDelay` is equal `MAX_UINT64` the // deauthorization reqest is pending and an operator have to call // `joinSortitionPool` or `updateOperatorStatus` to activate the request. // In that case we can't estimate when the deauthorization request // started. - isDeauthorizationReqestActive = false + isDeauthorizationRequestActive = false } // If the deauthorization request is not active or the // `_remainingAuthorizationDecreaseDelay` is equal `0` we can't estimate // when the deauthorization was requested. const deauthorizationCreatedAt = - !isDeauthorizationReqestActive || + !isDeauthorizationRequestActive || _remainingAuthorizationDecreaseDelay.eq(ZERO) ? undefined : BigNumber.from(requestTimestamp.toString()) @@ -346,7 +346,7 @@ export class Application implements IApplication { authorizedStake, pendingAuthorizationDecrease, remainingAuthorizationDecreaseDelay, - isDeauthorizationReqestActive, + isDeauthorizationRequestActive, deauthorizationCreatedAt, isOperatorInPool, operator,