Skip to content

Error Lesson 6 #291

Answered by cromewar
irwingtello asked this question in Q&A
Discussion options

You must be logged in to vote

It seems your problem is on your get_account function, which is returning accounts[1]... make sure it seems like this:

 import accounts

FORKED_LOCAL_ENVIRONMENTS = ["mainnet-fork", "mainnet-fork-dev"]
LOCAL_BLOCKCHAIN_ENVIRONMENTS = ["development", "ganache-local"]

def get_account():
    if (
        network.show_active() in LOCAL_BLOCKCHAIN_ENVIRONMENTS
        or network.show_active() in FORKED_LOCAL_ENVIRONMENTS
    ):
        return accounts[0]
    else:
        return accounts.add(config["wallets"]["from_key"])

also change ganache-local to ganache-gui, and add it to LOCAL_BLOCKCHAIN_ENVIRONMENTS, this should work.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by irwingtello
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants