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

fix: Handle MsgUnjail transactions #41

Merged
merged 1 commit into from
May 25, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions server/src/account/handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ export const updateTxToAccounts = async (rawTx, t) => {
const {
fromAccount: from, toAccount: to, executed,
} = rawTx;

// This function must work only for 'panacea*' accounts (not 'panaceavaloper*' and so on).
if (!from.startsWith('panacea1')) { // hrp + '1' (separator)
return;
}

const fromAccount = await getAccountFromDB(from, t);
const fromAccountBalance = await requestAccountBalance(from);
const fromAccountStakingBalance = await requestAccountStakingBalance(from);
Expand Down
3 changes: 3 additions & 0 deletions server/src/converter.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ export const txConverter = (data) => {
toAccount = m.value.to_address;
amount = m.value.amount ? m.value.amount[0].amount : 0;
break;
case 'cosmos-sdk/MsgUnjail':
fromAccount = m.value.address;
break;
case 'aol/MsgCreateTopic':
case 'aol/MsgAddWriter':
case 'aol/MsgDeleteWriter':
Expand Down