From cf4c58b3274676939afce9088ebefb6bb337e332 Mon Sep 17 00:00:00 2001 From: Daniel Blanco Parla Date: Tue, 13 Aug 2019 21:40:01 +0200 Subject: [PATCH 01/10] Created new routes, new pages, and SC Vote interaction for NewAuthorizations --- src/common/lang/en.js | 5 +- .../Node/NodeAuthorize/NewAuthorization.vue | 6 + .../AuthorizationMgmtSesameseed.vue | 399 ++++++++++++++++++ .../Sesameseed/NewAuthorizationSesameseed.vue | 193 +++++++++ .../Sesameseed/SesameseedVars.js | 1 + src/renderer/router/index.js | 7 +- 6 files changed, 609 insertions(+), 2 deletions(-) create mode 100644 src/renderer/components/Node/NodeAuthorize/Sesameseed/AuthorizationMgmtSesameseed.vue create mode 100644 src/renderer/components/Node/NodeAuthorize/Sesameseed/NewAuthorizationSesameseed.vue create mode 100644 src/renderer/components/Node/NodeAuthorize/Sesameseed/SesameseedVars.js diff --git a/src/common/lang/en.js b/src/common/lang/en.js index 97bb5c5..6c1f0ec 100644 --- a/src/common/lang/en.js +++ b/src/common/lang/en.js @@ -637,5 +637,8 @@ exchange: { changelly: 'Changelly', cryptonex: 'Cryptonex', loading: 'Loading latest pricing information, please wait..' - } + }, +sesameseed: { + stakeAmountTip: 'Stake amount for Sesameseed is 1 unit equals 1 ONT' +} } diff --git a/src/renderer/components/Node/NodeAuthorize/NewAuthorization.vue b/src/renderer/components/Node/NodeAuthorize/NewAuthorization.vue index a35d335..0fa106a 100644 --- a/src/renderer/components/Node/NodeAuthorize/NewAuthorization.vue +++ b/src/renderer/components/Node/NodeAuthorize/NewAuthorization.vue @@ -93,6 +93,12 @@ export default { tx: '' } }, + mounted: function() { + // Sesameseed NewAuthorizacion custom page + if (this.current_node.address === 'ANRRE8xKwKzuaCeAjP6eZYDnVi7n2x6byE') { + this.$router.push({name: 'NewAuthorizationSesameseed'}); + } + }, computed:{ ...mapState({ current_node: state => state.NodeAuthorization.current_node, diff --git a/src/renderer/components/Node/NodeAuthorize/Sesameseed/AuthorizationMgmtSesameseed.vue b/src/renderer/components/Node/NodeAuthorize/Sesameseed/AuthorizationMgmtSesameseed.vue new file mode 100644 index 0000000..25c1622 --- /dev/null +++ b/src/renderer/components/Node/NodeAuthorize/Sesameseed/AuthorizationMgmtSesameseed.vue @@ -0,0 +1,399 @@ + + + diff --git a/src/renderer/components/Node/NodeAuthorize/Sesameseed/NewAuthorizationSesameseed.vue b/src/renderer/components/Node/NodeAuthorize/Sesameseed/NewAuthorizationSesameseed.vue new file mode 100644 index 0000000..08406e4 --- /dev/null +++ b/src/renderer/components/Node/NodeAuthorize/Sesameseed/NewAuthorizationSesameseed.vue @@ -0,0 +1,193 @@ + + + + diff --git a/src/renderer/components/Node/NodeAuthorize/Sesameseed/SesameseedVars.js b/src/renderer/components/Node/NodeAuthorize/Sesameseed/SesameseedVars.js new file mode 100644 index 0000000..bdeaf3f --- /dev/null +++ b/src/renderer/components/Node/NodeAuthorize/Sesameseed/SesameseedVars.js @@ -0,0 +1 @@ +export const CONTRACT_HASH = '3298afa0bef16840138c9720a167e8b20b4c526f' \ No newline at end of file diff --git a/src/renderer/router/index.js b/src/renderer/router/index.js index 24caf53..4b0677f 100644 --- a/src/renderer/router/index.js +++ b/src/renderer/router/index.js @@ -31,7 +31,7 @@ export default new Router({ component: require('@/components/Setting').default }, { - path: '/Exchange', + path: '/Exchange', name: 'Exchange', component: require('@/components/Exchange').default }, @@ -200,6 +200,11 @@ export default new Router({ name: 'NewAuthorization', component: require('@/components/Node/NodeAuthorize/NewAuthorization').default }, + { + path: '/node/newAuthorizationSesameseed', + name: 'NewAuthorizationSesameseed', + component: require('@/components/Node/NodeAuthorize/Sesameseed/NewAuthorizationSesameseed').default + }, { path: '/oep4Home', name: 'Oep4Home', From 979cb19cd1a06b59934546a9f5fdb2d6c49c1726 Mon Sep 17 00:00:00 2001 From: Daniel Blanco Parla Date: Tue, 13 Aug 2019 22:16:21 +0200 Subject: [PATCH 02/10] Fixed navigation, added new tip texts, vars, routes, ... --- src/common/lang/en.js | 6 +- src/common/lang/zh.js | 5 ++ .../Node/NodeAuthorize/AuthorizationMgmt.vue | 6 ++ .../Node/NodeAuthorize/NewAuthorization.vue | 5 +- .../AuthorizationMgmtSesameseed.vue | 89 ++----------------- .../Sesameseed/NewAuthorizationSesameseed.vue | 6 +- .../Sesameseed/SesameseedVars.js | 3 +- src/renderer/router/index.js | 5 ++ 8 files changed, 35 insertions(+), 90 deletions(-) diff --git a/src/common/lang/en.js b/src/common/lang/en.js index 6c1f0ec..64b520e 100644 --- a/src/common/lang/en.js +++ b/src/common/lang/en.js @@ -639,6 +639,8 @@ exchange: { loading: 'Loading latest pricing information, please wait..' }, sesameseed: { - stakeAmountTip: 'Stake amount for Sesameseed is 1 unit equals 1 ONT' -} + stakeAmountTip: 'Stake amount for Sesameseed is 1 unit equals 1 ONT', + authorizeTip: 'If a new stake is canceled, it will add to the “canceled” ONT and be directly deposited in the users account within 24 hours. If authorized ONT from a previous consensus round is canceled it will be added to the “canceled” ONT and be directly deposited in the originating users account within 24 hours of the beginning of the next consensus round if Sesameseed is a candidate node (or one round later if Sesameseed is a consensus node). If a user has both authorized ONT from this consensus round and a previous round and cancels an ONT amount exceeding the amount from this round, they will receive authorized ONT from this consensus round first and the remaining authorized ONT in the next round.', + rewardTip: 'Sesameseed rewards Ontology Stake Authorizations in SEED for both foundation rewards created as a candidate or consensus node as an OEP-4 token “SEED”. This token is rewarded directly to Staking participants. In addition to node rewards, 100% of ONG unbound while staking is pooled by all stake authorizations and added to the total “Node Reward”, as a result this node reward is also provided in the form of “SEED” Token. Rewards are distributed daily without the need to redeem. Find out more at https://sesameseed.org.' + } } diff --git a/src/common/lang/zh.js b/src/common/lang/zh.js index e7331b5..8559d39 100644 --- a/src/common/lang/zh.js +++ b/src/common/lang/zh.js @@ -632,5 +632,10 @@ export default { changelly: 'Changelly', cryptonex: 'Cryptonex', loading: 'Loading latest pricing information, please wait..' + }, + sesameseed: { + stakeAmountTip: 'Stake amount for Sesameseed is 1 unit equals 1 ONT', + authorizeTip: 'If a new stake is canceled, it will add to the “canceled” ONT and be directly deposited in the users account within 24 hours. If authorized ONT from a previous consensus round is canceled it will be added to the “canceled” ONT and be directly deposited in the originating users account within 24 hours of the beginning of the next consensus round if Sesameseed is a candidate node (or one round later if Sesameseed is a consensus node). If a user has both authorized ONT from this consensus round and a previous round and cancels an ONT amount exceeding the amount from this round, they will receive authorized ONT from this consensus round first and the remaining authorized ONT in the next round.', + rewardTip: 'Sesameseed rewards Ontology Stake Authorizations in SEED for both foundation rewards created as a candidate or consensus node as an OEP-4 token “SEED”. This token is rewarded directly to Staking participants. In addition to node rewards, 100% of ONG unbound while staking is pooled by all stake authorizations and added to the total “Node Reward”, as a result this node reward is also provided in the form of “SEED” Token. Rewards are distributed daily without the need to redeem. Find out more at https://sesameseed.org.' } } diff --git a/src/renderer/components/Node/NodeAuthorize/AuthorizationMgmt.vue b/src/renderer/components/Node/NodeAuthorize/AuthorizationMgmt.vue index 1c04057..f6e81da 100644 --- a/src/renderer/components/Node/NodeAuthorize/AuthorizationMgmt.vue +++ b/src/renderer/components/Node/NodeAuthorize/AuthorizationMgmt.vue @@ -205,6 +205,7 @@ import {GAS_PRICE, GAS_LIMIT} from '../../../../core/consts' import {Crypto, GovernanceTxBuilder, utils} from 'ontology-ts-sdk' import numeral from 'numeral' import {varifyPositiveInt} from '../../../../core/utils.js' +import { SESAMESEED_NODE_ADDRESS } from './Sesameseed/SesameseedVars' export default { name:'AuthorizationMgmt', @@ -229,6 +230,11 @@ export default { //fetch stake info // const pk = this.stakeDetail.publicKey + // Redirect to Sesameseed NewAuthorizacion custom page + if (this.current_node.address === SESAMESEED_NODE_ADDRESS) { + this.$router.push({name: 'AuthorizationMgmtSesameseed'}); + } + this.refresh(); this.intervalId = setInterval(()=>{ this.refresh(); diff --git a/src/renderer/components/Node/NodeAuthorize/NewAuthorization.vue b/src/renderer/components/Node/NodeAuthorize/NewAuthorization.vue index 0fa106a..d82355e 100644 --- a/src/renderer/components/Node/NodeAuthorize/NewAuthorization.vue +++ b/src/renderer/components/Node/NodeAuthorize/NewAuthorization.vue @@ -77,6 +77,7 @@ import SignSendTx from '../../Common/SignSendTx' import {mapState} from 'vuex' import {GAS_LIMIT, GAS_PRICE} from '../../../../core/consts' import {Crypto, GovernanceTxBuilder, utils} from 'ontology-ts-sdk' +import { SESAMESEED_NODE_ADDRESS } from './Sesameseed/SesameseedVars' export default { name: 'NewAuthorization', @@ -94,8 +95,8 @@ export default { } }, mounted: function() { - // Sesameseed NewAuthorizacion custom page - if (this.current_node.address === 'ANRRE8xKwKzuaCeAjP6eZYDnVi7n2x6byE') { + // Redirect to Sesameseed NewAuthorizacion custom page + if (this.current_node.address === SESAMESEED_NODE_ADDRESS) { this.$router.push({name: 'NewAuthorizationSesameseed'}); } }, diff --git a/src/renderer/components/Node/NodeAuthorize/Sesameseed/AuthorizationMgmtSesameseed.vue b/src/renderer/components/Node/NodeAuthorize/Sesameseed/AuthorizationMgmtSesameseed.vue index 25c1622..f0dbc86 100644 --- a/src/renderer/components/Node/NodeAuthorize/Sesameseed/AuthorizationMgmtSesameseed.vue +++ b/src/renderer/components/Node/NodeAuthorize/Sesameseed/AuthorizationMgmtSesameseed.vue @@ -115,37 +115,9 @@
- {{$t('nodeMgmt.authorizeTip')}} + {{$t('sesameseed.authorizeTip')}}
{{$t('nodeMgmt.cancelAuthorization')}} -
-

- - - - - {{$t('nodeMgmt.locked')}}: - - {{authorizationInfo.locked}} ONT -

-

- - {{$t('nodeMgmt.claimable')}}: - - {{authorizationInfo.claimable}} ONT - {{$t('nodeMgmt.redeem')}} -

-

- - - - - {{$t('nodeMgmt.unboundOng')}}: - - {{unboundOng}} ONG - {{$t('nodeMgmt.redeem')}} -

-

{{$t('nodeMgmt.rewards')}}

@@ -158,11 +130,9 @@ {{splitFee.amount}} ONG

- {{$t('nodeMgmt.redeem')}} -

- {{$t('nodeMgmt.rewardTip')}} + {{$t('sesameseed.rewardTip')}}

@@ -198,13 +168,13 @@ diff --git a/src/renderer/router/index.js b/src/renderer/router/index.js index 06aa2fa..e3b0405 100644 --- a/src/renderer/router/index.js +++ b/src/renderer/router/index.js @@ -190,6 +190,11 @@ export default new Router({ name: 'AuthorizeLogin', component: require('@/components/Node/NodeAuthorize/AuthorizeLogin').default }, + { + path: '/node/authorizeLoginSesameseed', + name: 'AuthorizeLoginSesameseed', + component: require('@/components/Node/NodeAuthorize/Sesameseed/AuthorizeLoginSesameseed').default + }, { path: '/node/authorizationMgmt', name: 'AuthorizationMgmt', From 8b2075787e9dff548eccdaedcc89ab6e0ba8ceea Mon Sep 17 00:00:00 2001 From: Daniel Blanco Parla Date: Fri, 16 Aug 2019 18:12:19 +0200 Subject: [PATCH 09/10] removed max authorizations and changed redirect to Login --- .../AuthorizationMgmtSesameseed.vue | 624 +++++++++--------- 1 file changed, 317 insertions(+), 307 deletions(-) diff --git a/src/renderer/components/Node/NodeAuthorize/Sesameseed/AuthorizationMgmtSesameseed.vue b/src/renderer/components/Node/NodeAuthorize/Sesameseed/AuthorizationMgmtSesameseed.vue index 6b3c405..67a271c 100644 --- a/src/renderer/components/Node/NodeAuthorize/Sesameseed/AuthorizationMgmtSesameseed.vue +++ b/src/renderer/components/Node/NodeAuthorize/Sesameseed/AuthorizationMgmtSesameseed.vue @@ -1,331 +1,341 @@ From 0430a1cada95b5f7dc3298b87eb20dbc0cc005ee Mon Sep 17 00:00:00 2001 From: Daniel Blanco Parla Date: Fri, 16 Aug 2019 18:15:46 +0200 Subject: [PATCH 10/10] updated navigation history --- .../AuthorizationMgmtSesameseed.vue | 2 +- .../Sesameseed/NewAuthorizationSesameseed.vue | 54 +++++++++---------- 2 files changed, 28 insertions(+), 28 deletions(-) diff --git a/src/renderer/components/Node/NodeAuthorize/Sesameseed/AuthorizationMgmtSesameseed.vue b/src/renderer/components/Node/NodeAuthorize/Sesameseed/AuthorizationMgmtSesameseed.vue index 67a271c..3ba7d80 100644 --- a/src/renderer/components/Node/NodeAuthorize/Sesameseed/AuthorizationMgmtSesameseed.vue +++ b/src/renderer/components/Node/NodeAuthorize/Sesameseed/AuthorizationMgmtSesameseed.vue @@ -237,7 +237,7 @@ export default { this.$store.dispatch("fetchSSPerInfo", address); }, handleRouteBack() { - this.$router.go(-2); + this.$router.go(-1); }, newStakeAuthorization() { this.$router.push({ name: "NewAuthorizationSesameseed" }); diff --git a/src/renderer/components/Node/NodeAuthorize/Sesameseed/NewAuthorizationSesameseed.vue b/src/renderer/components/Node/NodeAuthorize/Sesameseed/NewAuthorizationSesameseed.vue index b2bf655..f9906e2 100644 --- a/src/renderer/components/Node/NodeAuthorize/Sesameseed/NewAuthorizationSesameseed.vue +++ b/src/renderer/components/Node/NodeAuthorize/Sesameseed/NewAuthorizationSesameseed.vue @@ -85,7 +85,7 @@ import SignSendTx from "../../../Common/SignSendTx"; import { mapState } from "vuex"; import { GAS_LIMIT, GAS_PRICE } from "../../../../../core/consts"; import { Crypto, TransactionBuilder, utils } from "ontology-ts-sdk"; -import { CONTRACT_HASH } from './SesameseedVars' +import { CONTRACT_HASH } from "./SesameseedVars"; export default { name: "NewAuthorizationSesameseed", @@ -111,7 +111,7 @@ export default { }, methods: { handleRouteBack() { - this.$router.go(-2); + this.$router.go(-1); }, handleChange() { if (!this.units || !varifyPositiveInt(this.units)) { @@ -158,32 +158,32 @@ export default { } const userAddr = new Crypto.Address(this.stakeWallet.address); const tx = TransactionBuilder.makeTransactionsByJson({ - action: 'invoke', - params: { - login: true, - message: 'Sesameseed Vote', - invokeConfig: { - contractHash: CONTRACT_HASH, - functions: [ - { - operation: 'Vote', - args: [ - { - name: 'from_acct', - value: 'Address:' + this.stakeWallet.address - }, - { - name: 'amount', - value: this.amount - } - ] - } - ], - gasLimit: GAS_LIMIT, - gasPrice: GAS_PRICE, - payer: this.stakeWallet.address - } + action: "invoke", + params: { + login: true, + message: "Sesameseed Vote", + invokeConfig: { + contractHash: CONTRACT_HASH, + functions: [ + { + operation: "Vote", + args: [ + { + name: "from_acct", + value: "Address:" + this.stakeWallet.address + }, + { + name: "amount", + value: this.amount + } + ] + } + ], + gasLimit: GAS_LIMIT, + gasPrice: GAS_PRICE, + payer: this.stakeWallet.address } + } }); this.tx = tx[0]; this.signVisible = true;