question-mark
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.

Calling with `sender=ContractInstance` doesn't work

See original GitHub issue

Environment information

  • ape and plugin versions:
$ ape --version
0.1.3

$ ape plugins list
Installed Plugins:
  ens          
  hardhat      
  infura       
  vyper        
  etherscan    
  solidity     
  tokens  
  • Python Version: 3.9.9
  • OS: linux

What went wrong?

When using a network provider that supports transactions without signatures (such as forked mode networks or local test networks), ape doesn’t support calling via a ContractInstance object as sender e.g.:

one_contract.mutableCall(..., sender=another_contract)

How can it be fixed?

The signature check in certain providers checks to see if sender is not of type AddressType before switching to using the signature check, which is missing ContractInstance (this is done because of a circular dependency). Just add the extra support for ContractInstace as well. Could even have it always convert the sender argument to AddressType, if signing is not required on that network.

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
fubuloubucommented, Mar 27, 2022

quick fix to ContractTransaction:

    def _get_type(self, kwarg_name: str) -> Any:
        return TransactionAPI.__fields__[kwarg_name].type_

    def serialize_transaction(self, *args, **kwargs) -> TransactionAPI:
        kwargs = {
            k: self.conversion_manager.convert(
                v,
                # TODO: Upstream, `TransactionAPI.sender` should be `AddressType` (not `str`)
                AddressType if k == "sender" else self._get_type(k),
            )
            for k, v in kwargs.items()
        }
        ...
Read more comments on GitHub >

github_iconTop Results From Across the Web

Make a call with Wi-Fi Calling - Apple Support
On your iPad, go to Settings > FaceTime. Then turn on Calls from iPhone. On your Mac, open the FaceTime app and choose...
Read more >
Can't call, dropped calls, & other calling issues - T-Mobile
Can't make or receive calls; Dropped calls; All incoming calls go to voicemail; Touch tones don't work; Stuck? Contact Us. Read me first....
Read more >
Trouble with phone calls or Wi-Fi calls - Google Fi Help
Check the "Wi-Fi calling" settings in the Fi app: Open the Google Fi app Fi . Tap the Account tab. Under "Phone settings,"...
Read more >
Troubleshooting calls in the Phone Link app - Microsoft Support
Troubleshooting steps for the calling feature of the Phone Link app. ... Why don't calls work after changing my Android device name?
Read more >
Stop Unwanted Robocalls and Texts
Don't answer calls from unknown numbers. · You may not be able to tell right away if an incoming call is spoofed. ·...
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 Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found