Skip to content

Commit

Permalink
Merge pull request #123 from TxnLab/dev
Browse files Browse the repository at this point in the history
  • Loading branch information
drichar authored May 2, 2024
2 parents d346b13 + cb009f0 commit 7efc28d
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 6 deletions.
2 changes: 1 addition & 1 deletion contracts/bootstrap/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "bootstrap",
"version": "0.8.0",
"version": "0.8.1",
"description": "",
"main": "index.ts",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion contracts/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "reti-contracts",
"version": "0.8.0",
"version": "0.8.1",
"license": "MIT",
"scripts": {
"generate-client": "algokit generate client contracts/artifacts/ --language typescript --output contracts/clients/{contract_name}Client.ts && ./update_contract_artifacts.sh``",
Expand Down
2 changes: 1 addition & 1 deletion ui/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "reti-ui",
"version": "0.8.0",
"version": "0.8.1",
"author": {
"name": "Doug Richar",
"email": "[email protected]"
Expand Down
2 changes: 1 addition & 1 deletion ui/src/components/ValidatorDetails/Details.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ export function Details({ validator }: DetailsProps) {
params={{ validatorId: String(validator.config.sunsettingTo) }}
className="hover:underline underline-offset-4"
>
Validator 4
Validator {validator.config.sunsettingTo}
</Link>
</AlertDescription>
</Alert>
Expand Down
2 changes: 1 addition & 1 deletion ui/src/components/ValidatorDetails/EditSunsettingInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ export function EditSunsettingInfo({ validator }: EditSunsettingInfoProps) {
defaultMonth={field.value}
selected={field.value}
onSelect={field.onChange}
disabled={(date) => date < dayjs().add(24, 'hours').toDate()}
disabled={(date) => dayjs(date).isBefore(dayjs().startOf('day'))}
onDayClick={() => setIsCalendarOpen(false)}
initialFocus
/>
Expand Down
8 changes: 7 additions & 1 deletion ui/src/utils/contracts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import {
ValidatorConfig,
ValidatorState,
} from '@/interfaces/validator'
import { dayjs } from '@/utils/dayjs'

export function transformValidatorConfig(rawConfig: RawValidatorConfig): ValidatorConfig {
return {
Expand Down Expand Up @@ -263,7 +264,12 @@ export function isStakingDisabled(
const maxStakersReached = totalStakers >= maxStakers
const maxStakeReached = Number(totalAlgoStaked) >= maxStake

return noPools || maxStakersReached || maxStakeReached
const isSunsetted =
validator.config.sunsettingOn > 0
? dayjs.unix(validator.config.sunsettingOn).isBefore(dayjs())
: false

return noPools || maxStakersReached || maxStakeReached || isSunsetted
}

export function isUnstakingDisabled(
Expand Down

0 comments on commit 7efc28d

Please sign in to comment.