Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid returnOrderId in bitshares/market sell/buy type annotation #173

Closed
Algruun opened this issue Jan 17, 2019 · 1 comment
Closed

Invalid returnOrderId in bitshares/market sell/buy type annotation #173

Algruun opened this issue Jan 17, 2019 · 1 comment

Comments

@Algruun
Copy link
Contributor

Algruun commented Jan 17, 2019

In annotation returnOrderId is string

:param string returnOrderId: If set to "head" or "irreversible" the call will wait for the tx to appear in
                                        the head/irreversible block and add the key "orderid" to the tx output

But it used only like a bool

        if returnOrderId:
            # Make blocking broadcasts
            prevblocking = self.blockchain.blocking
            self.blockchain.blocking = returnOrderId

        tx = self.blockchain.finalizeOp(order, account["name"], "active", **kwargs)

        if returnOrderId:
            tx["orderid"] = tx["operation_results"][0][1]
            self.blockchain.blocking = prevblocking
Algruun added a commit to Algruun/python-bitshares that referenced this issue Jan 17, 2019
Algruun added a commit to Algruun/python-bitshares that referenced this issue Jan 17, 2019
@xeroc
Copy link
Member

xeroc commented Feb 21, 2019

This is a rather hacky details.
Basically, the blocking variable is read in transactionsbuilder.TransactionBuilder.broadcast() and results in instanciating blockchain.Blockchain with the value of blocking as mode. That results in the blockchain.BLockchain.blocks() call to only look for blocks that are either "head" (most recent) or "irreversible".

I am open for suggestions to make those more clear and easier to maintain

@xeroc xeroc closed this as completed May 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants