Skip to content

Commit

Permalink
♻️ Refactor validator domain
Browse files Browse the repository at this point in the history
Rename remaining changes from delegate to validator
Rename votes related terminology to stakes
Created new hooks to resolve staking issues
At this checkpoint register validator, staking, unstaking transactions are working
  • Loading branch information
ManuGowda committed Jan 9, 2023
1 parent 62fa282 commit 96f5e10
Show file tree
Hide file tree
Showing 66 changed files with 535 additions and 406 deletions.
2 changes: 1 addition & 1 deletion setup/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ module.exports = {
'src/modules/common/components/filterDropdownButton/addressFilter.js',
'src/modules/transaction/components/TransactionRow/index.js',
'src/modules/transaction/manager/transactionSummary.js',
'src/modules/pos/validator/store/reducers/voting.js',
'src/modules/pos/validator/store/reducers/staking.js',
'src/modules/transaction/components/TransactionResult/illustrationsMap.js',
'src/modules/transaction/components/Regular/Regular.js',
'src/utils/withFilters.js',
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 4 additions & 4 deletions src/locales/en/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,11 @@
"At this moment there is a connection problem with the tweets feed": "At this moment there is a connection problem with the tweets feed",
"Available balance": "Available balance",
"Available balance: ": "Available balance: ",
"Available to unlock": "Available to unlock",
"Awaiting slot": "Awaiting slot",
"BLS Key": "BLS Key",
"BLS Proof Of Possession": "BLS Proof Of Possession",
"BLS Proof of possession": "BLS Proof of possession",
"BLS key": "BLS key",
"BLS proof of possession": "BLS proof of possession",
"Back": "Back",
"Back to validators": "Back to validators",
"Back to wallet": "Back to wallet",
Expand Down Expand Up @@ -673,6 +672,7 @@
"Undo": "Undo",
"Unlock": "Unlock",
"Unlock LSK Summary": "Unlock LSK Summary",
"Unlock stakes": "Unlock stakes",
"Unnamed account": "Unnamed account",
"Update now": "Update now",
"Upload file is required": "Upload file is required",
Expand All @@ -684,6 +684,7 @@
"Validator": "Validator",
"Validator #{{rank}}": "Validator #{{rank}}",
"Validator Forging Status": "Validator Forging Status",
"Validator name": "Validator name",
"Validator registration succeeded": "Validator registration succeeded",
"Validator weight": "Validator weight",
"Validators": "Validators",
Expand All @@ -697,7 +698,6 @@
"View all tokens": "View all tokens",
"View multisignature account details": "View multisignature account details",
"View remaining": "View remaining",
"View your validator profile in the wallet page.": "View your validator profile in the wallet page.",
"Volume": "Volume",
"Wallet": "Wallet",
"Wallet address:": "Wallet address:",
Expand Down Expand Up @@ -733,6 +733,7 @@
"You have uploaded an incorrect file": "You have uploaded an incorrect file",
"You haven't paired with any applications yet.": "You haven't paired with any applications yet.",
"You will be able to:": "You will be able to:",
"You will be notified when your transaction is confirmed.": "You will be notified when your transaction is confirmed.",
"Your LSK tokens could not be reclaimed, you can try again or report to us via email": "Your LSK tokens could not be reclaimed, you can try again or report to us via email",
"Your account just received {{amount}} {{token}} {{message}}": "Your account just received {{amount}} {{token}} {{message}}",
"Your balance will be transfered in a few seconds.": "Your balance will be transfered in a few seconds.",
Expand All @@ -747,7 +748,6 @@
"Your transaction has been submitted and will appear in sender account's wallet after confirmation.": "Your transaction has been submitted and will appear in sender account's wallet after confirmation.",
"Your transaction is signed successfully.": "Your transaction is signed successfully.",
"Your transaction is submitted to network, you can now track the status of this transaction in your wallet.": "Your transaction is submitted to network, you can now track the status of this transaction in your wallet.",
"Your username": "Your username",
"[Tomorrow], hh:mm A": "[Tomorrow], hh:mm A",
"added": "added",
"again to your application list.": "again to your application list.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -213,9 +213,9 @@ export const mockCommandParametersSchemas = {
maxItems: 20,
items: {
type: 'object',
required: ['delegateAddress', 'amount'],
required: ['validatorAddress', 'amount'],
properties: {
delegateAddress: {
validatorAddress: {
dataType: 'bytes',
fieldNumber: 1,
minLength: 20,
Expand Down
6 changes: 3 additions & 3 deletions src/modules/common/components/bars/topBar/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ import TopBar from './topBar';
const mapStateToProps = state => ({
stakeCount: containsTransactionType(
state.transactions.pending,
MODULE_COMMANDS_NAME_MAP.voteDelegate,
MODULE_COMMANDS_NAME_MAP.stake,
) ? 0
: Object.values(state.voting)
.filter(vote => (vote.confirmed !== vote.unconfirmed))
: Object.values(state.staking)
.filter(stake => (stake.confirmed !== stake.unconfirmed))
.length,
});

Expand Down
4 changes: 4 additions & 0 deletions src/modules/common/components/illustration/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ import trezorHwRejectionDark from '@setup/react/assets/images/illustrations/hw-r
import ledgerNanoHwRejection from '@setup/react/assets/images/illustrations/hw-rejection-ledger-nano.svg';
import ledgerNanoHwRejectionDark from '@setup/react/assets/images/illustrations/hw-rejection-ledger-nano-dark.svg';
import addApplicationSuccess from '@setup/react/assets/images/illustrations/add-application-success.svg';
import validatorRegistrationSuccess from '@setup/react/assets/images/illustrations/validator-registration-success.svg';
import validatorRegistrationError from '@setup/react/assets/images/illustrations/validator-registration-error.svg';

export const illustrations = {
welcomeLiskValidators,
Expand Down Expand Up @@ -109,6 +111,8 @@ export const illustrations = {
ledgerNanoHwRejection,
ledgerNanoHwRejectionDark,
addApplicationSuccess,
validatorRegistrationSuccess,
validatorRegistrationError,
};

const Illustration = ({ name, className, noTheme, ...props }) => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-disable import/prefer-default-export */

const generateStakes = (index) => ({
delegateAddress: `lsktzb4j7e3knk4mkxckdr3y69gtu2nwmsb3hjbkg`,
validatorAddress: `lsktzb4j7e3knk4mkxckdr3y69gtu2nwmsb3hjbkg`,
amount: `1000${index}`,
name: `liskhq-${index}`,
});
Expand Down
14 changes: 7 additions & 7 deletions src/modules/pos/validator/__fixtures__/mockSentStakes.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,37 +2,37 @@

const generateStakes = [
{
delegateAddress: `lskgtrrftvoxhtknhamjab5wenfauk32z9pzk79uj`,
validatorAddress: `lskgtrrftvoxhtknhamjab5wenfauk32z9pzk79uj`,
amount: `1000000000`,
name: 'liskhq',
},
{
delegateAddress: `lskdxc4ta5j43jp9ro3f8zqbxta9fn6jwzjucw7yt`,
validatorAddress: `lskdxc4ta5j43jp9ro3f8zqbxta9fn6jwzjucw7yt`,
amount: `1000000000`,
name: 'liskhq',
},
{
delegateAddress: `lskhbxua8tpdckcewntcttfqfo4rbatampo2dgrno`,
validatorAddress: `lskhbxua8tpdckcewntcttfqfo4rbatampo2dgrno`,
amount: `1000000000`,
name: 'liskhq',
},
{
delegateAddress: `lsk93msac7pppaqaxy2w84fcpfvq45caxtguednsp`,
validatorAddress: `lsk93msac7pppaqaxy2w84fcpfvq45caxtguednsp`,
amount: `1000000000`,
name: 'liskhq',
},
{
delegateAddress: `lsktusrzku8a8adxxcqqx83msxz34dphs8k4xmnhb`,
validatorAddress: `lsktusrzku8a8adxxcqqx83msxz34dphs8k4xmnhb`,
amount: `1000000000`,
name: 'liskhq',
},
{
delegateAddress: `lsktzb4j7e3knk4mkxckdr3y69gtu2nwmsb3hjbkg`,
validatorAddress: `lsktzb4j7e3knk4mkxckdr3y69gtu2nwmsb3hjbkg`,
amount: `1000000000`,
name: 'liskhq',
},
{
delegateAddress: `lsk74ar23k2zk3mpsnryxbxf5yf9ystudqmj4oj6e`,
validatorAddress: `lsk74ar23k2zk3mpsnryxbxf5yf9ystudqmj4oj6e`,
amount: `1000000000`,
name: 'liskhq',
},
Expand Down
Loading

0 comments on commit 96f5e10

Please sign in to comment.