回調不包含結果錯誤:錯誤:ethjs-q你___和噸Hjs−q在和r是ethjs-query格式化 RPC 的輸出時
最近,每次我嘗試與合約函式互動時,使用
MetaMask (version 3.9.4)
andRemix - Solidity IDE
,我都會收到這個錯誤回調不包含結果錯誤:錯誤:
$$ ethjs-query $$為方法 ‘getBlockByNumber’ 格式化來自 RPC ‘{…}’ 的輸出時錯誤:$$ ethjs-format $$十六進製字元串 ‘0x00’ 必須是字母數字 42 utf8 字節十六進制(字元:a-fA-F)字元串,為 4 字節
我用
testrpc
.為了重現錯誤,我使用了
Ballot
打開Remix - Solidity IDE
. 我只是簡單地呼叫了函式vote
。這是一個螢幕截圖:在您看來,可能是什麼問題?
我不知道這是否會感興趣,但我最近更新了
Chrome
(我目前的版本是60.0.3112.90
)和MetaMask (version 3.9.4)
.我還注意到,當我第二次嘗試部署同一個合約時,會發生同樣的錯誤。
編輯
回調不包含結果錯誤:錯誤:
$$ ethjs-query $$而格式化從RPC輸出“{”號“:”0×01“,”散列“:”0x202130c6cf3da71ef4ecd825756026ca7ae8778c1351f84afb0fe33f2d700dd8“,”parentHash“:”0x4ab8c5feac60b61978fea09f5d85b6948dfb05145a80a697da301829cd1399df“,”隨機數“:”為0x0“,”sha3Uncles“:”0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347“,”logsBloom“ :“0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000“,”transactionsRoot“:”0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421“,”stateRoot“:”0x48c03fd8d78b45ef04c24d22e5e90342f488604b7c88d92804699f2eaf433328“,”receiptRoot“:”0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421“,”礦工“:”0x000000000000000000000000000000000000000000”,“難度”:“0x0”,“totalDifficulty”:“0x0”,“extraData”:“0x0”,“size”:“0x03e8”,“gasLimit”:“0x47e7c4”,“gasUsed”:“0x096017” “時間戳”:“0x59857e81”,“交易”:$$ {“hash”:“0x8b0eb39901c9f73cf8155acba32a165ab5adf29d7f2503f267e9b8279b26ca74”,“nonce”:“0x0”,“blockHash”:“0x202130c6cf3da71ef4ecd825756026ca7ae8778c1351f84afb0fe33f2d700dd8”,“blockNumber”:“0x01”,“transactionIndex”:“0x00”,“from”:“0x78de6e90d3ac971e4924b34a397d5d3afd91801a”,“to”:“0x0”,“value”:“0x0”,“gas”:“0x096017”,“gasPrice”:“0x04a817c800”,“input”:“0x6060604052341561000f57600080fd5b604051602080610864833981016040528080519060200190919050505b336000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060018060008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001819055508060ff166002816100e591906100ed565b505b50610140565b815481835581811511610114578183600052602060002091820191016101139190610119565b5b505050565b61013d91905b80821115610139576000808201600090555060010161011f565b5090565b90565b6107158061014f6000396000f30060606040526000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680635c19a95c1461005f578063609ff1bd146100985780639e7b8d61146100c7578063b3f98adc14610100575b600080fd5b341561006a57600080fd5b610096600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610126565b005b34156100a357600080fd5b6100ab61047d565b604051808260ff1660ff16815260200191505060405180910390f35b34156100d257600080fd5b6100fe600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610505565b005b341561010b57600080fd5b610124600480803560ff16906020019091905050610602565b005b600080600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002091508160010160009054906101000a900460ff161561018657610478565b5b600073ffffffffffffffffffffffffffffffffffffffff16600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010160029054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141580156102b457503373ffffffffffffffffffffffffffffffffffffffff16600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010160029054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614155b1561032357600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010160029054906101000a900473ffffffffffffffffffffffffffffffffffffffff169250610187565b3373ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561035c57610478565b60018260010160006101000a81548160ff021916908315150217905550828260010160026101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002090508060010160009054906101000a900460ff161561046057816000015460028260010160019054906101000a900460ff1660ff1681548110151561043c57fe5b906000526020600020900160005b5060000160008282540192505081905550610477565b816000015481600001600082825401925050819055505b5b505050565b6000806000809150600090505b6002805490508160ff1610156104ff578160028260ff168154811015156104ad57fe5b906000526020600020900160005b506000015411156104f15760028160ff168154811015156104d857fe5b906000526020600020900160005b506000015491508092505b5b808060010191505061048a565b5b505090565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415806105ad5750600160008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010160009054906101000a900460ff165b156105b7576105ff565b60018060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001819055505b50565b6000600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002090508060010160009054906101000a900460ff168061066a57506002805490508260ff1610155b15610674576106e5565b60018160010160006101000a81548160ff021916908315150217905550818160010160016101000a81548160ff021916908360ff160217905550806000015460028360ff168154811015156106c557fe5b906000526020600020900160005b50600001600082825401925050819055505b50505600a165627a7a72305820b1f3a8079ba1019f7627b877660dd8cba1bcc422f6c4b3fa77ee8dec1ad01ce800290000000000000000000000000000000000000000000000000000000000000004”} $$“叔叔”:$$ $$}’ 對於方法 ‘getBlockByNumber’ 錯誤:$$ ethjs-format $$十六進製字元串 ‘0x00’ 必須是字母數字 42 utf8 字節十六進制(字元:a-fA-F)字元串,在 cb 處為 4 個字節(chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/scripts/background.js:43819:31)在 chrome -extension://nkbihfbeogaeaoehlefnkodbefgpgknn/scripts/background.js:43910:12 at chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/scripts/background.js:64308:9 at chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/scripts/background.js:10069 :16 在補充 (chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/scripts/background.js:9949:25) 在 iterateeCallback (chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/scripts/background.js:9939:17) 在 chrome-extension:/ /nkbihfbeogaeaoehlefnkodbefgpgknn/scripts/background.js:10085:16 at resultObj.id (chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/scripts/background.js:64288:9) 在 chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/scripts/background.js:10160:16 在補充 (chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/scripts/background.js:9954:17)
我通過啟用自動探勘來為自己解決了這個問題
testrpc --blocktime 5
,其中 5 是 testrpc 探勘新塊所需的秒數。
根據錯誤堆棧跟踪,我可以看到 MetaMask 內部發生了此錯誤,並且 MetaMask 似乎從其 RPC 提供程序接收到意外響應。
要進行更詳細的調查,我需要查看引發此錯誤時的 MetaMask 後台日誌,以便隔離觸發此錯誤的響應。
打開 MetaMask 的後台日誌的說明在這裡: https ://github.com/MetaMask/faq/blob/master/LOGS.md#background-logs-chrome
由於它似乎是某種未處理的響應錯誤,這是一個用 MetaMask 本身打開的好錯誤,這裡: https ://github.com/MetaMask/metamask-plugin/issues/new