Skip to content

Commit

Permalink
Remove unused code and unclear logs
Browse files Browse the repository at this point in the history
  • Loading branch information
tombeynon committed Oct 24, 2023
1 parent d467691 commit 25f7a56
Showing 1 changed file with 1 addition and 27 deletions.
28 changes: 1 addition & 27 deletions src/utils/Helpers.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -62,29 +62,6 @@ export function buildExecableMessage(type, typeUrl, value, shouldExec){
}

export function parseGrants(grants, grantee, granter) {
// claimGrant is removed but we track for now to allow revoke
const claimGrant = grants.find((el) => {
if (
(!el.grantee || el.grantee === grantee) &&
(!el.granter || el.granter === granter) &&
(el.authorization["@type"] ===
"/cosmos.authz.v1beta1.GenericAuthorization" &&
el.authorization.msg ===
"/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward")
) {
if (el.expiration === null) {
timeStamp("claimGrant does NOT expire!")
return true;
} else if (Date.parse(el.expiration) > new Date()) {
return true;
} else {
timeStamp("claimGrant expired!")
return false;
}
} else {
return false;
}
});
const stakeGrant = grants.find((el) => {
if (
(!el.grantee || el.grantee === grantee) &&
Expand All @@ -99,21 +76,18 @@ export function parseGrants(grants, grantee, granter) {
))
) {
if (el.expiration === null) {
timeStamp("stakeGrant does NOT expire!")
return true;
} else if (Date.parse(el.expiration) > new Date()) {
return true;
} else {
timeStamp("stakeGrant expired!")
return false;
}
} else {
return false;
}
})
return {
claimGrant,
stakeGrant,
stakeGrant
};
}

Expand Down

0 comments on commit 25f7a56

Please sign in to comment.