Skip to content
This repository has been archived by the owner on Jul 15, 2022. It is now read-only.

Commit

Permalink
Fix bot condition to do bond transactions
Browse files Browse the repository at this point in the history
  • Loading branch information
hakim-adamik committed May 13, 2022
1 parent 3e54f4d commit aaa3511
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions src/families/polkadot/specs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,14 @@ import {
canNominate,
isFirstBond,
getMinimumAmountToBond,
hasMinimumBondBalance,
} from "../../families/polkadot/logic";
import { DeviceModelId } from "@ledgerhq/devices";

const currency = getCryptoCurrencyById("polkadot");
// FIXME Should be replaced with EXISTENTIAL_DEPOSIT_RECOMMENDED_MARGIN in logic.ts
const POLKADOT_MIN_SAFE = parseCurrencyUnit(currency.units[0], "0.1");
// FIXME SHould be replaced with EXISTENTIAL_DEPOSIT in logic.ts
// FIXME Should be replaced with EXISTENTIAL_DEPOSIT in logic.ts
const EXISTENTIAL_DEPOSIT = parseCurrencyUnit(currency.units[0], "1.0");
const MIN_LOCKED_BALANCE_REQ = parseCurrencyUnit(currency.units[0], "1.0");
const polkadot: AppSpec<Transaction> = {
Expand Down Expand Up @@ -88,13 +89,7 @@ const polkadot: AppSpec<Transaction> = {
transaction: ({ account, bridge }) => {
invariant(account.polkadotResources, "polkadot");
invariant(canBond(account), "can't bond");
const { minimumBondBalance } = getCurrentPolkadotPreloadData();
invariant(
new BigNumber(100000).gt(
getMinimumAmountToBond(account, new BigNumber(minimumBondBalance))
),
"not enough balance to bond"
);
invariant(hasMinimumBondBalance(account), "not enough balance to bond");
const options: {
recipient?: string;
rewardDestination?: string;
Expand Down

1 comment on commit aaa3511

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

($22.99) for Bot 'Polkadot on Silicium'

⚠️ 6 mutations uncovered

Details of the 0 mutations

Spec Polkadot (3)

Spec Polkadot found 3 Polkadot accounts (preload: 7.9s). Will use Polkadot 12.9200.0 on nanoS 2.1.0
(13.7s) Polkadot 1 cross: 1.0619 DOT (164ops) (134PU8cEURfnfm9uH43zfLmSMzYv19qWmwb1vqndfyVbCVsX on 44'/354'/0'/0'/0') polkadotbip44#0 js:2:polkadot:134PU8cEURfnfm9uH43zfLmSMzYv19qWmwb1vqndfyVbCVsX:polkadotbip44
(9.9s) Polkadot 2: 1.0449 DOT (214ops) (1NxpxpMCxP8eV1ctrp8C3wXD7zN5f2WRNKENDa51w8e9hQC on 44'/354'/1'/0'/0') polkadotbip44#1 js:2:polkadot:1NxpxpMCxP8eV1ctrp8C3wXD7zN5f2WRNKENDa51w8e9hQC:polkadotbip44
(12.5s) Polkadot 3: 0 DOT (0ops) (11ysWistr6HA7ZQtAdyTWKTgwBfzTWKsACnxca4QQPGZHsG on 44'/354'/2'/0'/0') polkadotbip44#2 js:2:polkadot:11ysWistr6HA7ZQtAdyTWKTgwBfzTWKsACnxca4QQPGZHsG:polkadotbip44

Details of the 6 uncovered mutations

Spec Polkadot (6)

  • send 50%~: balance is too low (3)
  • bond - bondExtra: balance is too low (3)
  • unbond: balance is too low (3)
  • rebond: balance is too low (3)
  • nominate: balance is too low (3)
  • withdraw: balance is too low (3)

Portfolio ($22.99)

⚠️ 1 specs don't have enough funds! (Polkadot)

Details of the 1 currencies
Spec (accounts) Operations Balance funds?
Polkadot (1) 378 0.10649 DOT ($22.99) ❌ 134PU8cEURfnfm9uH43zfLmSMzYv19qWmwb1vqndfyVbCVsX

Please sign in to comment.