:param operation: :param args: :return:
(operation, args)
| 26 | |
| 27 | |
| 28 | def Main(operation, args): |
| 29 | """ |
| 30 | :param operation: |
| 31 | :param args: |
| 32 | :return: |
| 33 | """ |
| 34 | # 'init' has to be invokded first after deploying the contract to store the necessary and important info in the blockchain |
| 35 | if operation == 'init': |
| 36 | return init() |
| 37 | if operation == 'name': |
| 38 | return name() |
| 39 | if operation == 'symbol': |
| 40 | return symbol() |
| 41 | if operation == 'decimals': |
| 42 | return decimals() |
| 43 | if operation == 'totalSupply': |
| 44 | return totalSupply() |
| 45 | if operation == 'balanceOf': |
| 46 | if len(args) != 1: |
| 47 | return False |
| 48 | acct = args[0] |
| 49 | return balanceOf(acct) |
| 50 | if operation == 'transfer': |
| 51 | if len(args) != 3: |
| 52 | return False |
| 53 | else: |
| 54 | from_acct = args[0] |
| 55 | to_acct = args[1] |
| 56 | amount = args[2] |
| 57 | return transfer(from_acct,to_acct,amount) |
| 58 | if operation == 'transferMulti': |
| 59 | return transferMulti(args) |
| 60 | if operation == 'transferFrom': |
| 61 | if len(args) != 4: |
| 62 | return False |
| 63 | spender = args[0] |
| 64 | from_acct = args[1] |
| 65 | to_acct = args[2] |
| 66 | amount = args[3] |
| 67 | return transferFrom(spender,from_acct,to_acct,amount) |
| 68 | if operation == 'approve': |
| 69 | if len(args) != 3: |
| 70 | return False |
| 71 | owner = args[0] |
| 72 | spender = args[1] |
| 73 | amount = args[2] |
| 74 | return approve(owner,spender,amount) |
| 75 | if operation == 'allowance': |
| 76 | if len(args) != 2: |
| 77 | return False |
| 78 | owner = args[0] |
| 79 | spender = args[1] |
| 80 | return allowance(owner,spender) |
| 81 | if operation == 'testcase': |
| 82 | return testcase() |
| 83 | |
| 84 | return False |
| 85 |
nothing calls this directly
no test coverage detected