You are viewing a single comment's thread from:

RE: Confessions of a Lazy GM: Quick Encounter Design with the 5 Room Dungeon

It's the same issue as before, you are trying to put the key in the required auth or required posting auth:

I noticed in cancel order:

def cancel_order(account_name, order_id):
    """Cancel an order by its orderId."""
    payload = {
        "contractName": "market",
        "contractAction": "cancel",
        "contractPayload": {"orderId": str(order_id)},
    }
    tx = TransactionBuilder(blockchain_instance=hive)
    op = Custom_json(
        required_posting_auths=[HIVE_ACTIVE_KEY],  # <--- this is wrong
        required_auths=[account_name],
        id="ssc-mainnet-hive",
        json=jsonlib.dumps(payload),
    )
    tx.operations = [op]
    tx.sign()
    tx.broadcast()
    print(f"❎ Cancelled order: {order_id}")

Think of it this way, it'asking who's auth do we need, so we have the two fields: required_posting_auths=[] because we don't need anybody's posting auth for this call. Then in required_auths=[account_name] because we do need the active auth of the account for this call. Has nothing to do with the keys, just whose account do we need access to, to do this action. you could actually even omit the line you don't need at all for the custom json. for example it could very easily read:

    op = Custom_json(
        required_auths=[account_name],
        id="ssc-mainnet-hive",
        json=jsonlib.dumps(payload),
    )

You have this problem in a couple of the functions in place_order.py e.g. the buy / sell / cancel

Sort:  

Fudge.... Days of work. It's easy to get caught up in the same frame of mind. Appreciated. Want to work on a text based rpg?

I've also started on PEK Dex but that's a side project when I hit stalemate with things like this.

we don't "want" to work - we "want" to watch YOU work!

Im almost finished... On the precipice