第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

在 Hedera 上部署合約時出現(xiàn) ERROR_DECODING_BYTESTRING 錯誤

在 Hedera 上部署合約時出現(xiàn) ERROR_DECODING_BYTESTRING 錯誤

Go
慕絲7291255 2023-02-14 17:36:23
我正在嘗試在 Hedera 上部署合約;該文件是 9766 字節(jié),所以我創(chuàng)建了一個文件并將合同附加到它,但現(xiàn)在我收到錯誤“異常收據(jù)狀態(tài):ERROR_DECODING_BYTESTRING:檢索合同創(chuàng)建記錄時出錯”。我相信我的代碼做錯了什么。任何幫助將不勝感激。package blockchainimport (    "encoding/json"    "fmt"    "io/ioutil"    "github.com/.../scanner/env"    "github.com/hashgraph/hedera-sdk-go/v2")type contract struct {    Abi string `json:"abi"`    Bin string `json:"bin"`}type contracts struct {    Contracts map[string]contract `json:"contracts"`    Version   string              `json:"version"`}func DeployContract() {    var client *hedera.Client    var err error    // Retrieving network type from environment variable HEDERA_NETWORK    client, err = hedera.ClientForName(env.GetEnv["HEDERA_NETWORK"])    if err != nil {        println(err.Error(), ": error creating client")        return    }    // Retrieving operator ID from environment variable OPERATOR_ID    operatorAccountID, err := hedera.AccountIDFromString(env.GetEnv["OPERATOR_ID"])    if err != nil {        println(err.Error(), ": error converting string to AccountID")        return    }    // Retrieving operator key from environment variable OPERATOR_KEY    operatorKey, err := hedera.PrivateKeyFromString(env.GetEnv["OPERATOR_KEY"])    if err != nil {        println(err.Error(), ": error converting string to PrivateKey")        return    }    // Setting the client operator ID and key    client.SetOperator(operatorAccountID, operatorKey)    // Make sure to close client after running    defer func() {        err = client.Close()        if err != nil {            println(err.Error(), ": error closing client")            return        }    }()    // Read in the compiled contract from contract.json    rawSmartContract, err := ioutil.ReadFile("./contract/contract.json")    if err != nil {        println(err.Error(), ": error reading contract.json")        return    }
查看完整描述

1 回答

?
不負(fù)相思意

TA貢獻(xiàn)1777條經(jīng)驗 獲得超10個贊

我想我在 Discord 中對此做出了回應(yīng),但這里是為了完成。我認(rèn)為問題在于您的代碼Binbin.

轉(zhuǎn)變 smartContractByteCode := smartContract.Contracts["contract.sol:ScanInput"].Bin

為了

smartContractByteCode := smartContract.Contracts["contract.sol:ScanInput"].bin


查看完整回答
反對 回復(fù) 2023-02-14
  • 1 回答
  • 0 關(guān)注
  • 135 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號