Skip to content

Commit

Permalink
Merge pull request #49 from CudoVentures/cudos-dev
Browse files Browse the repository at this point in the history
Merge cudos-dev into cudos-master
  • Loading branch information
mlukanova authored Jun 28, 2022
2 parents 4ac453e + bf7a052 commit 82a0b5c
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 7 deletions.
6 changes: 6 additions & 0 deletions both/document.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-NWBZN9R');</script>
<!-- End Google Tag Manager -->
<!-- Hotjar Tracking Code for https://explorer-v1.cudos.org/ -->
<script> (function(h,o,t,j,a,r){ h.hj=h.hj||function(){(h.hj.q=h.hj.q||[]).push(arguments)};
h._hjSettings={hjid:3035068,hjsv:6}; a=o.getElementsByTagName('head')[0];
r=o.createElement('script');r.async=1; r.src=t+h._hjSettings.hjid+j+h._hjSettings.hjsv; a.appendChild(r); })
(window,document,'https://static.hotjar.com/c/hotjar-','.js?sv=');</script>
<!-- End Hotjar Tracking Code -->
<meta charset="utf-8" />
<title>CUDOS Explorer</title>
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
Expand Down
4 changes: 4 additions & 0 deletions both/utils/coins.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ constructor(amount, denom=Meteor.settings.public.bondDenom) {
this._coin = "";
this._amount = new BigNumber(amount);
}

if (this._coin.username) {
this._coin.denom = this._coin.username
}
}

get amount () {
Expand Down
8 changes: 7 additions & 1 deletion default_settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,13 @@
"denom": "cudos",
"displayName": "CUDOS",
"fraction": 1
}
},
{
"denom": "cudosAdmin",
"displayName": "cudosAdmin",
"username": "Admin Token",
"fraction": 1
}
],
"ledger":{
"coinType": 118,
Expand Down
2 changes: 1 addition & 1 deletion imports/ui/accounts/Account.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ class AccountDetails extends Component{

displayStakingDenom(denomType){
let findCoinType = Meteor.settings.public.coins.find(({denom}) => denom === denomType);
let currentCoinType = findCoinType ? findCoinType.displayName : null;
let currentCoinType = findCoinType ? findCoinType.username?findCoinType.username:findCoinType.displayName : null;
return currentCoinType
}

Expand Down
2 changes: 1 addition & 1 deletion imports/ui/blocks/Block.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export default class Block extends Component{
<Col md={4} className="label"><T>common.hash</T></Col>
<Col md={8} className="value text-nowrap overflow-auto address">{block.hash}</Col>
<Col md={4} className="label"><T>blocks.proposer</T></Col>
<Col md={8} className="value"><Link to={"/validator/"+((proposer)?proposer.operatorAddress:'')}><Avatar moniker={moniker} profileUrl={profileUrl} address={block.proposerAddress} list={true} /> {moniker}</Link></Col>
<Col md={8} className="value"><Link to={"/validator/"+((proposer)?proposer.address:'')}><Avatar moniker={moniker} profileUrl={profileUrl} address={block.proposerAddress} list={true} /> {moniker}</Link></Col>
<Col md={4} className="label"><T>blocks.numOfTransactions</T></Col>
<Col md={8} className="value">{numbro(block.transNum).format("0,0")}</Col>
<Col md={4} className="label"><T>common.time</T></Col>
Expand Down
4 changes: 3 additions & 1 deletion imports/ui/components/Activities.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,9 @@ export default class Activites extends Component {
case "/cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission":
return <p><Account address={msg.validator_address} /> {(this.props.invalid)?<T>activities.failedTo</T>:''}<MsgType type={msg["@type"]} /> {(!this.props.invalid)?<T _purify={false} amount={new Coin(events['withdraw_commission'][0].value.replace(Meteor.settings.public.bondDenom, ''), events['withdraw_commission'][0].value.replace(/[0-9]/g, '')).toString(6)}>activities.withAmount</T>:''} <T>common.fullStop</T></p>
case "/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward":
return <p><Account address={msg.delegator_address}/> {(this.props.invalid)?<T>activities.failedTo</T>:''}<MsgType type={msg["@type"]} /> {(!this.props.invalid)?<T _purify={false} amount={new Coin(events['withdraw_rewards'][0].value.replace(Meteor.settings.public.bondDenom, ''), events['withdraw_rewards'][0].value.replace(/[0-9]/g, '')).toString(6)}>activities.withAmount</T>:''} <T>activities.from</T> <Account address={msg.validator_address} /><T>common.fullStop</T></p>
const denom = events['withdraw_rewards'][0].value.replace(/[0-9]/g, '').toString(6)
const amountWithdrawn = events['withdraw_rewards'][0].value.replace(/[a-zA-Z]/g, '').toString(6)
return <p><Account address={msg.delegator_address}/> {(this.props.invalid)?<T>activities.failedTo</T>:''}<MsgType type={msg["@type"]} /> {(!this.props.invalid)?<T _purify={false} amount={amountWithdrawn?new Coin(amountWithdrawn, denom):"NO REWARD"}>activities.withAmount</T>:''} <T>activities.from</T> <Account address={msg.validator_address} /><T>common.fullStop</T></p>
case "/cosmos.distribution.v1beta1.MsgModifyWithdrawAddress":
return <p><Account address={msg.delegator_address}/> {(this.props.invalid)?<T>activities.failedTo</T>:''}<MsgType type={msg["@type"]} /></p>

Expand Down
2 changes: 1 addition & 1 deletion imports/ui/ledger/LedgerActions.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -608,7 +608,7 @@ class LedgerButton extends Component {
const chainId = Meteor.settings.public.chainId;
await window.keplr.enable(chainId);

const offlineSigner = window.getOfflineSigner(chainId);
const offlineSigner = window.getOfflineSignerOnlyAmino(chainId);

const rpcEndpoint = Meteor.settings.public.urls.rpc;
const client = await SigningStargateClient.connectWithSigner(rpcEndpoint, offlineSigner, {
Expand Down
4 changes: 2 additions & 2 deletions imports/ui/ledger/ledger.js
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ export class Ledger {
// If you don't request enabling before usage, there is no guarantee that other methods will work.
await window.keplr.enable(Meteor.settings.public.chainId);

const offlineSigner = window.getOfflineSigner(Meteor.settings.public.chainId);
const offlineSigner = window.getOfflineSignerOnlyAmino(Meteor.settings.public.chainId);
const account = (await offlineSigner.getAccounts())[0];

localStorage.setItem(CURRENTUSERADDR, account.address);
Expand All @@ -295,7 +295,7 @@ export class Ledger {
await Ledger.connectKeplr();
}

const offlineSigner = window.getOfflineSigner(Meteor.settings.public.chainId);
const offlineSigner = window.getOfflineSignerOnlyAmino(Meteor.settings.public.chainId);
let account = (await offlineSigner.getAccounts())[0];
return account;
}
Expand Down

0 comments on commit 82a0b5c

Please sign in to comment.