-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
70 lines (63 loc) · 2.24 KB
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
from django.core.management.base import BaseCommand
from smallest.lib import IsoManager
class Command(BaseCommand):
def add_arguments(self, parser):
parser.add_argument(
'--pool-list',
nargs='+',
type=str,
help='List of pools as strings',
required=True,
)
parser.add_argument(
'--start-epoch',
type=int,
help='Start epoch',
required=True,
)
parser.add_argument(
'--end-epoch',
type=int,
help='End epoch',
required=True,
)
parser.add_argument(
'--total-reward',
type=int,
help='Total reward',
required=True,
)
parser.add_argument(
'--smallest-bonus',
type=int,
help='Smallest bonus'
)
parser.add_argument(
'--whale-limiter',
type=int,
help='Whale limiter',
)
def handle(self, *args, **kwargs):
pool_list = kwargs['pool_list']
start_epoch = kwargs['start_epoch']
end_epoch = kwargs['end_epoch']
total_reward = kwargs['total_reward']
smallest_bonus = kwargs['smallest_bonus']
whale_limiter = kwargs['whale_limiter']
# Output the received arguments for demonstration purposes
self.stdout.write(self.style.SUCCESS('Pool list: {}'.format(pool_list)))
self.stdout.write(self.style.SUCCESS('Start epoch: {}'.format(start_epoch)))
self.stdout.write(self.style.SUCCESS('End epoch: {}'.format(end_epoch)))
self.stdout.write(self.style.SUCCESS('Total reward: {}'.format(total_reward)))
self.stdout.write(self.style.SUCCESS('Smallest bonus: {}'.format(smallest_bonus)))
self.stdout.write(self.style.SUCCESS('Whale limiter: {}'.format(whale_limiter)))
iso_manager = IsoManager(
pools=pool_list,
epoch_start=start_epoch,
epoch_end=end_epoch,
total_reward=total_reward,
smallest_bonus=smallest_bonus,
whale_limiter=whale_limiter,
)
iso_manager.build_rewards()
self.stdout.write(self.style.SUCCESS("ALL DONE!"))