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 a Non-Constant Method

See original GitHub issue

When I call a non-constant method with ethers,I follow the ethers guide ethers , it always return this transaction hash and transaction result together.
I just use metamsk, so I just modify json-rpc provider like below at json-rpc-provider.ts

 return this.sendUncheckedTransaction(transaction).then(function (hash){
          let tx = {hash}
          return _this.provider._wrapTransaction(tx, hash);
        })
        // return this.sendUncheckedTransaction(transaction).then(function (hash) {
        //     return web_1.poll(function () {
        //         return _this.provider.getTransaction(hash).then(function (tx) {
        //             if (tx === null) {
        //                 return undefined;
        //             }
        //             return _this.provider._wrapTransaction(tx, hash);
        //         });
        //     }, { fastRetry: 250, onceBlock: _this.provider }).catch(function (error) {
        //         error.transactionHash = hash;
        //         throw error;
        //     });
        // });

I hope official could fixed this for all provider

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
shaokun11commented, Sep 25, 2019

@ricmoo cool, you’re right, thanks a lot ^0^

0reactions
ricmoocommented, Sep 26, 2019

Closing this now, but if you have any further questions, please feel free to re-open.

Thanks! 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Call non-const function on a const object - c++ - Stack Overflow
1 Answer 1 · If the function is non-constant, it can only be called by a non-constant object. · If the function is...
Read more >
Can we call non-constant function in constant function? - Quora
You talk about “functions”; not “methods”; which means your question is “flawed”; somehow; you _can_ call _any_ kind of a function; within a...
Read more >
Variable functions - Manual - PHP
PHP supports the concept of variable functions. This means that if a variable name has parentheses appended to it, PHP will look for...
Read more >
Calling Methods - CODESYS Online Help
You call a method via a pointer to a function block (for example pfub^.method ). ; You call the method of an interface...
Read more >
Calling methods and accessing instance variables
An instance variable is accessed with the expression referenceVariable.instanceVariableName. Similarly, a method is called with the expression ...
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