首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Kadena Chainweaver部署合同失败: Tx失败:键集失败(键-任意)

Kadena Chainweaver部署合同失败: Tx失败:键集失败(键-任意)
EN

Stack Overflow用户
提问于 2022-01-01 21:33:14
回答 1查看 215关注 0票数 1

当我在VM (https://chainweaver-builds.s3.amazonaws.com/2.2/kadena-chainweaver-vm-2.2.0.1.ova)上部署与Kadena的Hello合同时,我得到了这个错误: Failure: Tx Failed: Keyset failure (键-any)

这是我正在尝试部署的契约(这是在创建chainweaver帐户时存在的默认hello world ):

代码语言:javascript
复制
;;
;; "Hello, world!" smart contract/module
;;
;; To try it out, click "Load into REPL" and type into the repl:
;; (free.hello-world.set-message "universe")
;; (free.hello-world.greet)
;;
;; Check lines 21 and 34 to play with Formal Verification
;;

(namespace "free")

;; Define the module.
(module hello-world MODULE_ADMIN
  "A smart contract to greet the world."

  ; no-op module admin for example purposes.
  ; in a real contract this could enforce a keyset, or
  ; tally votes, etc.
  (defcap MODULE_ADMIN () true)

  (defschema message-schema
    @doc "Message schema"
    @model [(invariant (!= msg ""))]

    msg:string)

  (deftable
    message:{message-schema})

  (defun set-message
    (
      m:string
    )
    "Set the message that will be used next"
    ; uncomment the following to make the model happy!
    ;(enforce (!= m "") "set-message: must not be empty")
    (write message "0" {"msg": m})
  )

  (defun greet ()
    "Do the hello-world dance"
    (with-default-read message "0" { "msg": "" } { "msg":= msg }
      (format "Hello {}!" [msg])))
)

(create-table message)

(set-message "world")
(greet)

失败: Tx失败:键集失败(键-任意)

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2022-01-01 21:45:12

当我将模块名从hello-world更改为其他内容时,问题就解决了。

改变这一点:

代码语言:javascript
复制
;; Define the module.
(module hello-world MODULE_ADMIN
  "A smart contract to greet the world."

对此:

代码语言:javascript
复制
;; Define the module.
(module hello-world-YOUR-UNIQUE-NAME MODULE_ADMIN
  "A smart contract to greet the world."
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/70552007

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档