mirror of
https://github.com/chaintool-py/eth-erc20.git
synced 2024-11-21 17:26:47 +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 GiftableToken
|
||||||
from .factory import bytecode
|
from .factory import bytecode
|
||||||
from .factory import create
|
from .factory import create
|
||||||
from .factory import default
|
from .factory import args
|
||||||
|
@ -103,11 +103,17 @@ class GiftableToken(TxFactory):
|
|||||||
return tx
|
return tx
|
||||||
|
|
||||||
|
|
||||||
def bytecode(version=None):
|
def bytecode(**kwargs):
|
||||||
return GiftableToken.bytecode(version=version)
|
return GiftableToken.bytecode(version=kwargs.get('version'))
|
||||||
|
|
||||||
|
|
||||||
def create(name, symbol, decimals, version=None):
|
def create(**kwargs):
|
||||||
return GiftableToken.cargs(name, symbol, decimals, version=version)
|
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