Skip to content
This repository has been archived by the owner on Dec 1, 2021. It is now read-only.

Commit

Permalink
Add tx log (#291)
Browse files Browse the repository at this point in the history
* add tx console log

* update changelog to v0.37.x-patch-10
  • Loading branch information
kwunyeung authored Feb 24, 2020
1 parent c488e88 commit c1983d9
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 61 deletions.
25 changes: 21 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,36 @@
# Changelog

## [Unreleased]
* Changed the structure of coins.js and settings.json
## v0.37.x-patch-10

### Release Date: 24 Feb 2020

* Changed the structure of `coins.js` utility and `settings.json`. Information of multiple denoms can be defined in `settings.json`. A `bondDenom` should be defined and coins information is defined in `coins` array. `powerReduction` is the `token / power` ratio which is set to be `1,000,000` by default in the `staking` module. The display value of coins should be set correctly in the `coins` array. An example is as below.

```json
"bondDenom": "umuon",
"powerReduction": 1000000,
"coins": [
{
"denom": "umuon",
"displayName": "Muon",
"displayNamePlural": "Muons",
"fraction": 1000000
}
],
```

* Update Meteor to v1.9
* [#267] Fixed Fee Decimal Places
* [#263] Fixed Tx fee to be displayed in Minting or Staking Denom depending on the fee amount
* [#262] Fixed Validator Popover in Account Section
* [#262] Fixed Validator Popover in Account Section
* [#260] Fixed Token unit to display the correct Denom Name/Type
* [#227] Added additional info to be displayed for Parameter Change Proposal and Community Pool Spend Proposal
* [#276] Added Coin Selection Dropdown in Account Section to support multiple denomination
* [#289] Updated Coin Selection Dropdown to display the denom as the display (Staking) denom and only show when more than one type of Coin is available.

## v0.37.x-patch-9

### Release Date: 22 Jan 2020
### Release Date: 22 Jan 2020

* Added features to disable `gov` and `mint` modules if they don't exist
* [#254] Fixed the delegation order in delegation panel
Expand Down
76 changes: 19 additions & 57 deletions imports/api/transactions/server/methods.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,64 +10,26 @@ Meteor.methods({
'Transactions.index': function(hash, blockTime){
this.unblock();
hash = hash.toUpperCase();
let url = LCD+ '/txs/'+hash;
let response = HTTP.get(url);
let tx = JSON.parse(response.content);

console.log(hash);

tx.height = parseInt(tx.height);

// if (!tx.code){
// let msg = tx.tx.value.msg;
// for (let m in msg){
// if (msg[m].type == "cosmos-sdk/MsgCreateValidator"){
// console.log(msg[m].value);
// let command = Meteor.settings.bin.gaiadebug+" pubkey "+msg[m].value.pubkey;
// let validator = {
// consensus_pubkey: msg[m].value.pubkey,
// description: msg[m].value.description,
// commission: msg[m].value.commission,
// min_self_delegation: msg[m].value.min_self_delegation,
// operator_address: msg[m].value.validator_address,
// delegator_address: msg[m].value.delegator_address,
// voting_power: Math.floor(parseInt(msg[m].value.value.amount) / 1000000)
// }

// Meteor.call('runCode', command, function(error, result){
// validator.address = result.match(/\s[0-9A-F]{40}$/igm);
// validator.address = validator.address[0].trim();
// validator.hex = result.match(/\s[0-9A-F]{64}$/igm);
// validator.hex = validator.hex[0].trim();
// validator.pub_key = result.match(/{".*"}/igm);
// validator.pub_key = JSON.parse(validator.pub_key[0].trim());
// let re = new RegExp(Meteor.settings.public.bech32PrefixAccPub+".*$","igm");
// validator.cosmosaccpub = result.match(re);
// validator.cosmosaccpub = validator.cosmosaccpub[0].trim();
// re = new RegExp(Meteor.settings.public.bech32PrefixValPub+".*$","igm");
// validator.operator_pubkey = result.match(re);
// validator.operator_pubkey = validator.operator_pubkey[0].trim();

// Validators.upsert({consensus_pubkey:msg[m].value.pubkey},validator);
// VotingPowerHistory.insert({
// address: validator.address,
// prev_voting_power: 0,
// voting_power: validator.voting_power,
// type: 'add',
// height: tx.height+2,
// block_time: blockTime
// });
// })
// }
// }
// }


let txId = Transactions.insert(tx);
if (txId){
return txId;
console.log("Get tx: "+hash)
try {
let url = LCD+ '/txs/'+hash;
let response = HTTP.get(url);
let tx = JSON.parse(response.content);

console.log(hash);

tx.height = parseInt(tx.height);

let txId = Transactions.insert(tx);
if (txId){
return txId;
}
else return false;

}
catch(e) {
console.log(e)
}
else return false;
},
'Transactions.findDelegation': function(address, height){
// following cosmos-sdk/x/slashing/spec/06_events.md and cosmos-sdk/x/staking/spec/06_events.md
Expand Down

0 comments on commit c1983d9

Please sign in to comment.