Code Monkey home page Code Monkey logo

Comments (4)

tinybike avatar tinybike commented on September 18, 2024

You can use callbacks instead:

var tx = {
    to: "0x8a7529b95f769cd0197cd7022cab5f4ef0874b31",
    function:"multiply",
    signature: "ii",
    params: [2, 3],
    send: true
};
EthRPC.invoke(tx, function (data) {
    var txhash = data.result;
    var pingTx = function () {
        EthRPC.getTx(txhash, function (res) {
            if (res && res.result && res.result.input) {
                EthRPC.call({
                    from: EthRPC.coinbase(),
                    to: res.result.to,
                    data: res.result.input
                }, function (h) {
                    if (h && h.result) {
                        console.log("return value: ", h.result);
                        clearInterval(timer);
                    }
                });
            }
        });
    };
    var timer = setInterval(pingTx, 12000);
});

Advantages of doing it this way: no increase in gas cost (for calling log), and also no need to update + re-broadcast all the Serpent contracts.

from augur-core.

scottzer0 avatar scottzer0 commented on September 18, 2024

thanks for this code, jack.

the callback use case should not be implemented as a log entry. this issue should be a backlog issue until the use cases come up.

from augur-core.

joeykrug avatar joeykrug commented on September 18, 2024

callbacks don't work for all transactions on the network... I don't get the result from Jim's callback in Texas after he buys some shares

Examples for later reference
event rabbit(x)
event frog(y:indexed)
event moose(a, b:str, c:indexed, d:arr)
def test_rabbit(eks): log(type=rabbit, eks)
def test_frog(why): log(type=frog, why)
def test_moose(eh, bee:str, see, dee:arr): log(type=moose, eh, bee, see, dee)

from augur-core.

joeykrug avatar joeykrug commented on September 18, 2024

Added logs for market pricing --- closing now --- open a new issue if any further logs wanted or reopen this one w/ a comment

from augur-core.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.