-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
59 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
import click | ||
from pprint import pprint | ||
from prettytable import PrettyTable | ||
from .decorators import onlineChain, unlockWallet, customchain | ||
from .main import main | ||
from .ui import pretty_print | ||
|
||
from peerplays.account import Account | ||
from peerplays.asset import Asset | ||
from peerplays.sport import Sport, Sports | ||
from peerplays.eventgroup import EventGroup, EventGroups | ||
from peerplays.event import Event, Events | ||
from peerplays.bettingmarketgroup import BettingMarketGroup, BettingMarketGroups | ||
from peerplays.rule import Rule, Rules | ||
from peerplays.proposal import Proposals | ||
from peerplays.storage import configStorage as config | ||
|
||
|
||
@main.group() | ||
def bos(): | ||
""" BOS related calls | ||
""" | ||
pass | ||
|
||
|
||
@bos.command() | ||
@click.pass_context | ||
@click.argument( | ||
"eventids", | ||
nargs=-1) | ||
@customchain(bundle=True) | ||
@unlockWallet | ||
def cancel_event(ctx, eventids): | ||
for eventid in eventids: | ||
Event(eventid) | ||
ctx.blockchain.event_update_status( | ||
eventid, | ||
"canceled", | ||
) | ||
click.echo(ctx.broadcast()) | ||
|
||
|
||
@bos.command() | ||
@click.pass_context | ||
@click.argument("account") | ||
@onlineChain | ||
@unlockWallet | ||
def approve_all(ctx, account): | ||
proposals = Proposals(account) | ||
proposal_ids = {x["id"] for x in proposals} | ||
click.echo(ctx.peerplays.approveproposal( | ||
proposal_ids, | ||
account=account | ||
)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,7 +34,8 @@ | |
bookie, | ||
message, | ||
rpc, | ||
asset | ||
asset, | ||
bos | ||
) | ||
|
||
log = logging.getLogger(__name__) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters