报错如下:
Traceback (most recent call last):
File "D:/NlBlock/text.py", line 33, in <module>
LC.submit_a_superblock(str(new_block.stringify_block()))
File "D:\NlBlock\e.py", line 199, in submit_a_superblock
.format(processed_receipt[0].args.sender, processed_receipt[0].args.superblock)
IndexError: tuple index out of range
代码如下:
processed_receipt = contract.events.SuperblockSubmission().processReceipt(tx_receipt)
print(processed_receipt)
output = "Address {} broadcasted the opinion: {}" \
.format(processed_receipt[0].args._soapboxer, processed_receipt[0].args._opinion)
print(output)
完整代码为Python以太坊智能合约开发指南(https://blog.csdn.net/weixin_34356310/article/details/93025947)
+指仅在application/x-www-form-urlencoded内容中的空间,例如URL的查询部分:
http://www.example.com/path/foo+bar/path?query+name=query+value
在这个URL中,参数名是query name带空格的,值是query value空格,但是路径中的文件夹名字是字面意思foo+bar,不是 foo bar。
%20是在这些上下文中编码空间的有效方法。所以,如果你需要URL编码列入一个字符串URL的一部分,它始终是安全的空格替换%20用和加号%2B。这是例如。encodeURIComponent()在JavaScript中。不幸的是,这不是什么urlencode在PHP(rawurlencode更安全)