Skip to content

Commit

Permalink
fix: fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
bacher committed Sep 23, 2019
1 parent 4548f00 commit 95531c1
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/controllers/BandwidthProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,14 +116,14 @@ class BandwidthProvider extends BasicController {
}

_verifyActionsAndCheckIsNeedProviding({ actions }) {
const provideBwAction = actions.find(this._isBWProvideAction);
const provideBwActions = actions.filter(this._isBWProvideAction);

if (!provideBwAction) {
if (provideBwActions.length === 0) {
return false;
}

for (const action of actions) {
if (action === provideBwAction) {
if (provideBwActions.includes(action)) {
continue;
}

Expand Down Expand Up @@ -236,7 +236,7 @@ class BandwidthProvider extends BasicController {
}

_checkProposalRestrictionsAndGetAction({ actions }, user) {
let targetActions = actions.filter(this._isBWProvideAction);
const targetActions = actions.filter(action => !this._isBWProvideAction(action));

if (targetActions.length !== 1) {
throw {
Expand All @@ -250,7 +250,7 @@ class BandwidthProvider extends BasicController {

const [targetAction] = targetActions;

const contractMethod = `${targetAction.code}::${targetAction.action}`;
const contractMethod = `${targetAction.account}::${targetAction.name}`;

if (!PROPOSAL_ALLOWED_CONTRACTS.includes(contractMethod)) {
throw {
Expand Down

0 comments on commit 95531c1

Please sign in to comment.