Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Sign: [y/N]: after first signed tx, this message doesn't react on N

See original GitHub issue

Environment information

  • OS: macOS
  • Python Version: x.x.x
  • ape and plugin versions: 0.2.1
$ ape --version

$ ape plugins list
ape-infura 0.2.0
ape-vyper 0.2.0
ape-etherscan 0.2.0
  • Contents of your ape-config.yaml (NOTE: do not post anything private like RPC urls or secrets!):
$ cat ape-config.yaml
contracts_folder: contracts

What went wrong?

Well, I use APE on testnet to generate a bunch of data for my web interface. With old version (I’m not sure what exactly version I have, maybe 1.5 or maybe 1.6) I ran with command ape run deploy_testing --network ethereum:rinkeby:infura I signed the first tx:

Sign:  [y/N]: y
Enter passphrase to unlock 'trader03' []: 
Leave 'trader03' unlocked? [y/N]: y

After that I just leave unlocked account and wait when script will done.

Well, I decided to rewrite some test from Brownie to APE and check how it will going. I installed ape-hardhat through PyCharm Python Interpreter. As I understood APE updated too automatically.

If the script has:

    owner = accounts.load("trader03")

I hasn’t any problems. But if delete these strings and continue to Sign Tx with hands when the next message appear:

Sign: [y/N]: 

it will react only positive, so if I type y,Y,n,N, or tap on ENTER, the result will be always Yes.

How to reproduce:


from ape import project
from ape import accounts

class InitToken(object):

    def load_accs(self, type):
        acc = accounts.load("trader03")

        if type > 0:

        return acc1

    def create_token(self, name, symbol, decimals, supply,  owner):
        token = owner.deploy(project.Token, name, symbol, decimals, supply)
        return token

    def token_approve(self, token, receiver, amount, sender):
        return token.approve(receiver, int(amount), sender=sender)

random_addr = 0xDf032Bc4B9dC2782Bb09352007D4C57B75160B15
### works fine with set_autosign
deploy = InitToken()

main_account = deploy.load_accs(1)
main_token = start_deploy.create_token("NAME", "SMBL", main_account)
deploy.token_approve(main_token, random_addr, 1e18, main_account)

### check Sing Tx without set_autosign and type N
deploy = InitToken()
main_account = deploy.load_accs(0)
main_token = start_deploy.create_token("NAME", "SMBL", main_account)
deploy.token_approve(main_token, random_addr, 1e18, main_account)
deploy.token_approve(main_token, random_addr, 1e18, main_account)
deploy.token_approve(main_token, random_addr, 1e18, main_account)

NOTE: First tx I signed and leave account open.

Sign:  [y/N]: y
Enter passphrase to unlock 'trader03' []: 
Leave 'trader03' unlocked? [y/N]: y

if account is locked, then everything works fine.

Please include information like:

  • what command you ran
  • the code that caused the failure (see this link for help with formatting code)
  • full output of the error you received

How can it be fixed?

Fill this in if you have ideas on how the bug could be fixed.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:12 (7 by maintainers)

github_iconTop GitHub Comments

unparalleled-jscommented, May 3, 2022

I was able to reproduce!

SwapOperatorcommented, May 3, 2022

@SwapOperator if you could please add more context that will help unblock us!

sorry I was busy these days. @unparalleled-js I made the small video 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

javascript - Redirect on Login - React.js - Stack Overflow
Currently, when I log in successfully, the alert You can't login if you are logged in! is set off, but I obviously don't...
Read more >
Signers - Ethers.js
A signed message is prefixd with "\x19Ethereum Signed Message:\n" and the length of the message, using the hashMessage method, so that it is...
Read more >
EIP-712: Typed structured data hashing and signing
A procedure for hashing and signing of typed structured data as opposed to just bytestrings.
Read more >
web3.eth — web3.js 1.0.0 documentation - Read the Docs
It will then sign locally using the private key of that account, and send the transaction via web3.eth.sendSignedTransaction(). If the properties chain and ......
Read more >
1st Amendment U.S. Constitution--Religion and Expression
FIRST AMENDMENT. Congress shall make no law respecting an establishment of religion, or prohibiting the free exercise thereof; or abridging.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Post

No results found

github_iconTop Related Hashnode Post

No results found