mirror of
https://github.com/chaintool-py/eth-erc20.git
synced 2024-12-21 23:17:33 +01:00
Add named variables scheme for chainlib gen, args definitions return
This commit is contained in:
parent
7ab3cd14f5
commit
db30d4aaf4
@ -1,4 +1,4 @@
|
||||
from .factory import GiftableToken
|
||||
from .factory import bytecode
|
||||
from .factory import create
|
||||
from .factory import default
|
||||
from .factory import args
|
||||
|
@ -103,11 +103,17 @@ class GiftableToken(TxFactory):
|
||||
return tx
|
||||
|
||||
|
||||
def bytecode(version=None):
|
||||
return GiftableToken.bytecode(version=version)
|
||||
def bytecode(**kwargs):
|
||||
return GiftableToken.bytecode(version=kwargs.get('version'))
|
||||
|
||||
|
||||
def create(name, symbol, decimals, version=None):
|
||||
return GiftableToken.cargs(name, symbol, decimals, version=version)
|
||||
def create(**kwargs):
|
||||
return GiftableToken.cargs(kwargs['name'], kwargs['symbol'], kwargs['decimals'], version=kwargs.get('version'))
|
||||
|
||||
default = bytecode
|
||||
|
||||
def args(v):
|
||||
if v == 'create':
|
||||
return (['name', 'symbol', 'decimals'], ['version'],)
|
||||
elif v == 'default' or v == 'bytecode':
|
||||
return ([], 'version',)
|
||||
raise ValueError('unknown command: ' + v)
|
||||
|
Loading…
Reference in New Issue
Block a user