Skip to content

Commit

Permalink
fix: fix testnet config
Browse files Browse the repository at this point in the history
  • Loading branch information
Korniichuk Oleksandr authored and esaminu committed Jan 19, 2022
1 parent f9ae81d commit 5412c14
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ export default function ValidatorBox({
}
};
const isProjectValidator = validator.version === ValidatorVersion[PROJECT_VALIDATOR_VERSION];
console.log(isProjectValidator, isProjectValidator && validator);
return (
<Container
className='validator-box'
Expand Down
4 changes: 3 additions & 1 deletion packages/frontend/src/redux/actions/staking.js
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,6 @@ export const { staking } = createActions({
totalUnclaimed = totalUnclaimed.add(new BN(validator.unclaimed));
const networkId = wallet.connection.provider.connection.url.indexOf(MAINNET) > -1 ? MAINNET : TESTNET;

console.log(networkId, validator.accountId);
validator.version = getValidationVersion(networkId, validator.accountId);
} catch (e) {
if (e.message.indexOf('cannot find contract code') === -1) {
Expand Down Expand Up @@ -419,6 +418,9 @@ export const { staking } = createActions({
};
const fee = validator.fee = await validator.contract.get_reward_fee_fraction();
fee.percentage = +(fee.numerator / fee.denominator * 100).toFixed(2);
const networkId = wallet.connection.provider.connection.url.indexOf(MAINNET) > -1 ? MAINNET : TESTNET;

validator.version = getValidationVersion(networkId, validator.accountId);
return validator;
} catch (e) {
console.warn('Error getting fee for validator %s: %s', account_id, e);
Expand Down
2 changes: 1 addition & 1 deletion packages/frontend/src/translations/pt.global.json
Original file line number Diff line number Diff line change
Expand Up @@ -1111,7 +1111,7 @@
},
"farm": {
"title": "Total token earned",
"info": "It's project validator",
"info": "This is project validator. You’ll get the farming reward while staking on it.",
"button": "Claim"
}
},
Expand Down
6 changes: 3 additions & 3 deletions packages/frontend/src/utils/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ export const VALIDATOR_VERSION = "VALIDATOR";
export const PROJECT_VALIDATOR_VERSION = "PROJECT_VALIDATOR";

export const ValidatorVersion = {
[VALIDATOR_VERSION]: 1,
[PROJECT_VALIDATOR_VERSION]: 2
[VALIDATOR_VERSION]: VALIDATOR_VERSION,
[PROJECT_VALIDATOR_VERSION]: PROJECT_VALIDATOR_VERSION
};

export const MAINNET = "mainnet";
export const TESTNET = "testnet";
export const PROJECT_VALIDATOR_PREFIX_MAINNET = ".near";
export const VALIDATOR_PREFIX_MAINNET = ".pool.near";
export const PROJECT_VALIDATOR_PREFIX_TESTNET = ".factory01.littlefarm.testnet";
export const PROJECT_VALIDATOR_PREFIX_TESTNET = "staked.pool.f863973.m0";
export const VALIDATOR_PREFIX_TESTNET = ".m0";

export const PROJECT_VALIDATOR_REGEXP_TESTNET = new RegExp(`.*(${PROJECT_VALIDATOR_PREFIX_TESTNET}|${VALIDATOR_PREFIX_TESTNET})`);
Expand Down

0 comments on commit 5412c14

Please sign in to comment.