ethereum - NFT:尝试运行 create_collectibles 脚本会引发执行恢复错误:这是来自 Patrick Collins Youtube 教程
问题描述
以下是脚本的片段: 在 VS 代码中使用 Brownie 错误:“气体估算失败:'执行已恢复'。此交易可能会恢复。如果您希望广播,则必须手动设置气体限制。”
from brownie import AdvancedCollectible, accounts, config
from scripts.helpful_scripts import get_breed
import time
STATIC_SEED = 123
def main():
dev = accounts.add(config["wallets"]["from_key"])
advanced_collectible = AdvancedCollectible[len(AdvancedCollectible) - 1]
transaction = advanced_collectible.createCollectible(
STATIC_SEED, "None", {"from": dev, "gas_limit": 50000}
)
print("Waiting on second transaction...")
# wait for the 2nd transaction
transaction.wait(1)
time.sleep(35)
requestId = transaction.events["requestedCollectible"]["requestId"]
token_id = advanced_collectible.requestIdToTokenId(requestId)
breed = get_breed(advanced_collectible.tokenIdToBreed(token_id))
print("Dog breed of tokenId {} is {}".format(token_id, breed))
解决方案
推荐阅读
- gun - GUN 中的密码重置恢复
- python-3.x - How to determine if two elements from a list appear consecutively in a string? Python
- drupal - Dropal 8:RouteSubscriber 类在 RegisterEventSubscribersPass 中不存在
- r - ts plot如何画黄土线
- apache-kafka-streams - Kafka 流窗口批处理
- java - 当活动和/或应用程序关闭时保持广播接收器运行?
- ruby - Ruby 2.4:如何加速正则表达式动态初始化以与 .match 一起使用?
- entity-framework - 将聚合选择表达式传递给 Dynamic Linq 的 GroupBy
- php - PHP/SQL:使用 PHP 将 $row['id'] 插入新表是插入所有行 ID,而不仅仅是一个
- java - 正则表达式在字符串中查找变量