Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Staking info per contract #325

Merged
merged 11 commits into from
Sep 6, 2024

Conversation

mohandast52
Copy link
Collaborator

@mohandast52 mohandast52 commented Sep 5, 2024

  • Added staking information
staking-info.mov
  • Refactored the following component
1

@mohandast52 mohandast52 added the enhancement New feature or request label Sep 5, 2024
@mohandast52 mohandast52 self-assigned this Sep 5, 2024
@mohandast52 mohandast52 changed the title (WIP) feat: Staking info per contract feat: Staking info per contract Sep 5, 2024
@mohandast52 mohandast52 marked this pull request as ready for review September 5, 2024 18:47
Copy link
Collaborator

@truemiller truemiller left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

couple changes, but looks good from a functional perspective!

frontend/components/ManageStakingPage/index.tsx Outdated Show resolved Hide resolved
frontend/components/ManageStakingPage/index.tsx Outdated Show resolved Hide resolved
frontend/components/ManageStakingPage/index.tsx Outdated Show resolved Hide resolved
frontend/components/ManageStakingPage/index.tsx Outdated Show resolved Hide resolved
frontend/service/Autonolas.ts Outdated Show resolved Hide resolved
Comment on lines +297 to +299
const rewardsPerWorkPeriod =
Number(formatEther(rewardsPerSecond as BigNumber)) *
livenessPeriod.toNumber();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the same functionality is in getAvailableRewardsForEpoch above
can we remove the function above? or consolidate them in some way?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I’ve added a TODO for now and will revisit it later when I have time.

frontend/service/Autonolas.ts Outdated Show resolved Hide resolved
frontend/types/Autonolas.ts Outdated Show resolved Hide resolved
@mohandast52 mohandast52 merged commit 1b235d1 into staging Sep 6, 2024
4 checks passed
@mohandast52 mohandast52 deleted the mohan/each-staking-contract-info branch September 6, 2024 11:02
mohandast52 added a commit that referenced this pull request Sep 12, 2024
* initial win support

* win: process kill fixes

* win: tendermint installation automated

* helthchecker env vars to switch it off. small refactoring

* service hash id updated

* use bundled in tendermint.exe, not download it

* lint fixes

* feat: add staking deployment vars

* feat: added pearl beta 2 address & section

* chore: add pearl beta 2 address

* chore: init

* chore: comment env example

* fix: isNil check for low balance

* fix: serviceFundRequirements coalesce

* refactor: order and map staking contracts

* fix: required olas when both staked and not staked

* feat: update StakingContractSection to support multi-contract

* feat: updated STAKING_PROGRAM_META with deprecated and supported migration targets

* fix: isAddress checks to protect against 0xm

* feat: added pearl_beta_2 to StakingContractInfo record

* feat: add pearl_beta_2 Beta2 enum

* chore: comment availableRewards until it's used

* feat: extend serviceStakingMechUsageContracts with pearl_beta_2, protect against -1 serviceId

* fix: protect against -1 serviceId related errors

* feat: add pearl_beta_2 requirement

* bump: rc124 for test release

* add staking contract update button in homepage

* update contract UI

* update

* win release updates

* add loading state

* workflow cleanup

* fix: default contract fallback, instead of "not staked"

* fix: broken import (kebabCase import)

* bump: rc125

* win build poetry version bump

* fix: added minimum staking duration to migration condition

* fix for windows tendermint bundle in

* fix: disable hash update

* fix: migration countdown, and minimum duration fix from staging

* fix: typos

* refactor: popover copy

* fix: typo

* fix for tendermint PATH env vars

* feat: Disable the staking contract button if the balance is low. (#317)

* feat: disable staking contract button if low balance

* feat: update staking contract button popover message

* feat: add useNeedsFunds hook

* feat: integrate useNeedsFunds hook for disable staking contract

* update logic

* refactor: remove OLAS requirement from notification

* fix: commented link to broken site

* feat: Staking info per contract (#325)

* refractor: tiny format document

* feat: add InfoBreakdown component

* feat: replace OlasBalanceSection with BalanceBreakdown

* refactor: Update InfoBreakdown component and add InfoBreakdownList

* feat: add more contract methods for staking info

* move from different function inside the main one (Autonolas.ts)

* feat: add types

* refactor: Update StakingContractSection component and add StakingContractInfo

* other changes

* feat: minor

* feat: address Josh review changes

* feat: Add balance polling pause functionality to StakingContractSection (#330)

* bump: rc126

* hotfix: undefined fixes in useStakingContractInfo hook for build 126

* refactor: simplify logic, remove New tag

* chore: remove redundant "New" objects

* fix: remove commented mistakenly commented code

* feat: Update backup wallet alert copy (#341)

* feat: Add backup wallet warning message

* update text

* refactor: cleanup staking program parse from contract

* chore: update minimum staking duration comment

* feat: add loader to staking contract info provider

* refactor: return loader from hook, rework comments, add service staked check

* refactor: match active staking program type meta with active staking program type

* refactor: rewrite staking contract section to consolidate, clean-up business logic

* chore: delete huge comment block (cantMigrateReason)

* fix: migrate button display logic

* fix: Release 0.1.0-rc126 issues (#342)

* Refactor SetupWelcome component to handle account setup state correctly

* feat: trigger IPC call on app load (with commented code)

* feat: remove all comments from main.js

* Update frontend/components/ManageStakingPage/StakingContractSection/index.tsx

* Update frontend/components/ManageStakingPage/StakingContractSection/index.tsx

* Update frontend/components/ManageStakingPage/StakingContractSection/index.tsx

Co-authored-by: Mohan <[email protected]>

* Update frontend/components/ManageStakingPage/StakingContractSection/index.tsx

* chore: prettier fix

* refactor: seperate CountdownUntilMigration

* hotfix: update actions/upload-artifact to v4

* hotfix: update checkout and download-artifact actions to v4

* fix: add version prefix

* bump: rc127

* refactor: numerous changes

* chore: fix leftover `stakingProgram` references

* chore: comment purpose

* fix: migration and funding button validation

* fix: migrate & funding button condition fixes

* refactor: can't migrate reason copy

* chore: leftover `stakingProgramId` refactor

* fix: experienced bug where alpha showed during migration

* fix: use Text component instead of span

* fix: Badge "Active" status to be displayed only on active staking contract  (#345)

* fix StakingContractTag

* fix

* fix: reinstate #345 changes after overwrite due to merge conflicts

* chore: better comment

* Update frontend/components/ManageStakingPage/StakingContractSection/CountdownUntilMigration.tsx

Co-authored-by: Mohan <[email protected]>

* Update frontend/components/ManageStakingPage/StakingContractSection/CountdownUntilMigration.tsx

---------

Co-authored-by: Yuri (solarw) Turchenkov <[email protected]>
Co-authored-by: jmoreira-valory <[email protected]>
Co-authored-by: truemiller <[email protected]>
Co-authored-by: Josh Miller <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants