如何调用带有类型参数的合同?
2 个回答
- 投票数
-
- 2019-02-11
根据 Michelson规范,您需要使用正确的调用约定.您应该使用以下内容:
(Pair "this is a string" "a signature string")
另一个观察-为什么重复进行SWAP?这样可以有效地使堆栈恢复到原来的状态.
As per the Michelson spec you need to use the correct calling convention. You should use the following:
(Pair "this is a string" "a signature string")
One other obeservation - Why do you have SWAP repeated? This effectively returns the stack to how it was.
-
谢谢一群!Micelson代码是从ReasonML-> Liquidity-> Michelson编译的,也许不是最佳的.我需要深入研究Michelson规范,并且一定要研究为什么代码中添加了重复的SWAP再次感谢!Thanks a bunch! The Micelson code was transpiled from ReasonML -> Liquidity -> Michelson, perhaps not optimal. I need to dig into the Michelson spec, and I'll be sure to look into why the code is adding that repeated SWAP Thanks again!
- 0
- 2019-02-12
- asbjornenge
-
- 2019-02-12
如果使用Liquidity的
next
分支,则可以使用:-
liquidity CONTRACT.liq --call-arg main '{ name = "test"; sig = "abcd" }'
打印tezos-client
(其中main
是所需的入口点)要使用的参数 -
liquidity --re CONTRACT.liq
可直接使用ReasonML语法编译文件(还要在上一个命令中添加--re
参数)
(双
SWAP
是未经过优化的生成代码,在以后的版本中,我们将在Michelson代码上添加优化步骤)If you use the
next
branch of Liquidity, you can use :liquidity CONTRACT.liq --call-arg main '{ name = "test"; sig = "abcd" }'
to print the argument to be used bytezos-client
(wheremain
is the entry point you want)liquidity --re CONTRACT.liq
to directly compile a file in ReasonML syntax (add the--re
argument in the previous command also)
(the double
SWAP
is under-optimized generated code, we will add a pass of optimization on the Michelson code in a later version)-
真好!感谢您的巨大反馈,这里将尝试`next`分支Nice! Thanks for great feedback here Will try the `next` branch
- 1
- 2019-02-12
- asbjornenge
我有以下合同:
如何使用
doc
类型作为参数来调用该合同?我发现的所有示例都使用单个字符串或整数作为参数.我一直在尝试:
tezos-client transfer 0 from yolo to docs --arg '{ name = "test"; sig = "abcd" }'
但是我想这就是流动性表达参数的方式吗?