gpt4 book ai didi

nearprotocol - sputnikdao2 - ChangePolicy - "data did not match any variant of untagged enum VersionedPolicy"

转载 作者:行者123 更新时间:2023-12-04 13:07:09 27 4
gpt4 key购买 nike

我正在尝试更改已部署的 sputnikdao2 合约的政策。

我收到这个错误:

   "ExecutionError":"`Smart contract panicked: panicked at 'Failed to deserialize input from JSON.: Error(\"data did not match any variant of untagged enum VersionedPolicy\", line: 1, column: 423)', src/proposals.rs:384:1`"
},
"transaction_outcome":{
"block_hash":"8aUiGxnJv12BASyKjPKVsYWegEmbH8Lz1LsXu7gGXFwa",
"id":"FTTFLVZzzrK7CT6KCNqWVCs67Hc5oBRHBT9TqCciqjY6",
"outcome":{
"executor_id":"hundred.testnet",
"gas_burnt":2428900339092,
"logs":[

],
"receipt_ids":[
"EuNWubtxcY9YjcbTxSwrrYj59GBVj8u6a8RktQj7tHSh"
],
"status":{
"SuccessReceiptId":"EuNWubtxcY9YjcbTxSwrrYj59GBVj8u6a8RktQj7tHSh"
},
"tokens_burnt":"242890033909200000000"
},
"proof":[
{
"direction":"Left",
"hash":"9eTyjRrHrNP1Bmw4rDgSouGmvxP7Lg3EaoUn15qBQH3h"
},
{
"direction":"Right",
"hash":"4NLf8mPom49oVbXmB2ouujxctjbyZC5FBi5ny1NFcXYj"
}
]
}
}

您可以在此处查看更多信息: https://gist.github.com/hiba-machfej/3a681d22fc2310966ca7692ec3a189d2

最佳答案

我正试图发送这个:

'{"proposal": {"description": "Add New Council", "kind": {"ChangePolicy": { "policy": { "roles": [{ "name": "all", "kind": "Everyone", "permissions": [ "*:AddProposal" ], "vote_policy": "{}"}], "default_vote_policy": { "weight_kind": "RoleWeight", "quorum": "0", "threshold": [ 1, 2 ] }, "proposal_bond": "1000000000000000000000000", "proposal_period": "604800000000000", "bounty_bond": "1000000000000000000000000", "bounty_forgiveness_period": "86400000000000"}}}}}' \
--accountId hundred.testnet \
--amount 1

我再次重写了这些对象并且成功了:

'{"proposal": {"description": "Add New Council", "kind": {"ChangePolicy": { "policy": {  "roles": [{ "name": "all", "kind": "Everyone", "permissions": ["*:AddProposal", "*:Finalize"], "vote_policy": {}}], "default_vote_policy": { "weight_kind": "RoleWeight", "quorum": "0", "threshold": [ 1, 2 ]}, "proposal_bond": "1000000000000000000000000", "proposal_period": "604800000000000", "bounty_bond": "1000000000000000000000000", "bounty_forgiveness_period": "86400000000000" }}}}}' \
--accountId hundred.testnet \
--amount 1

这是收据: https://explorer.testnet.near.org/transactions/DxXLUUcx2jcLdoCFT2HbhSinWV6zjSREUkNXnN3kkHD4

我认为我运行的第一个代码中存在 json 格式错误。

关于nearprotocol - sputnikdao2 - ChangePolicy - "data did not match any variant of untagged enum VersionedPolicy",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/68862577/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com