Skip to content
This repository has been archived by the owner on Mar 15, 2024. It is now read-only.

bet command causes unorderable types error in the API #103

Open
unsystemizer opened this issue Dec 30, 2016 · 1 comment
Open

bet command causes unorderable types error in the API #103

unsystemizer opened this issue Dec 30, 2016 · 1 comment

Comments

@unsystemizer
Copy link
Contributor

unsystemizer commented Dec 30, 2016

I don't know why this doesn't work, I may troubleshoot later.

bet --source n4D7ndiC4yLZxhAf726uMHXC914sEuUAcg --feed-address mu3FsSTC12dHvUoxr2eEfjmheGRBQZZAdC --bet-type Equal --deadline 2016-12-30T21:39:00-0500 --wager 0.001 --counterwager 0.002 --target-value 1 --expiration 10

Version: counterparty-client v1.1.2; counterparty-lib v9.55.1

Error:

ERROR:root:Unhandled Exception
Traceback (most recent call last):
  File "/usr/local/bin/counterparty-client", line 11, in <module>
    load_entry_point('counterparty-cli==1.1.2', 'console_scripts', 'counterparty-client')()
  File "/usr/local/lib/python3.5/dist-packages/counterpartycli/__init__.py", line 12, in client_main
    client.main()
  File "/usr/local/lib/python3.5/dist-packages/counterpartycli/client.py", line 364, in main
    unsigned_hex = messages.compose(args.action, args)
  File "/usr/local/lib/python3.5/dist-packages/counterpartycli/messages.py", line 278, in compose
    return compose_transaction(args, message, param_names)
  File "/usr/local/lib/python3.5/dist-packages/counterpartycli/messages.py", line 269, in compose_transaction
    unsigned_tx_hex = util.api(method, params)
  File "/usr/local/lib/python3.5/dist-packages/counterpartycli/util.py", line 92, in api
    return rpc(config.COUNTERPARTY_RPC, method, params=params, ssl_verify=config.COUNTERPARTY_RPC_SSL_VERIFY)
  File "/usr/local/lib/python3.5/dist-packages/counterpartycli/util.py", line 89, in rpc
    raise RPCError('{}'.format(response_json['error']))
counterpartycli.util.RPCError: {'message': 'Server error', 'code': -32000, 'data': {'message': 'unorderable types: int() < NoneType()', 'args': ['unorderable types: int() < NoneType()'], 'type': 'APIError'}}
@unsystemizer
Copy link
Contributor Author

Here's some debug info:

bet --source n4D7ndiC4yLZxhAf726uMHXC914sEuUAcg --feed-address mu3FsSTC12dHvUoxr2eEfjmheGRBQZZAdC --bet-type Equal --deadline 2016-12-30T23:59:00 --wager 0.001 --counterwager 0.002 --target-value 1 --expiration 10
  • Request sent to the server in JSON format is below:
{
	"method": "create_bet",
	"params": {
		"encoding": "auto",
		"pubkey": ["0265f9763ea8f857571a003a9c7abddc9875a3dd921dbdb15c1659944869f945cd"],
		"dust_return_pubkey": null,
		"op_return_value": 0,
		"fee_per_kb": 25000,
		"feed_address": "mu3FsSTC12dHvUoxr2eEfjmheGRBQZZAdC",
		"source": "n4D7ndiC4yLZxhAf726uMHXC914sEuUAcg",
		"target_value": 1.0,
		"leverage": 5040,
		"disable_utxo_locks": false,
		"deadline": 1483142340,
		"regular_dust_size": 5429,
		"fee": null,
		"expiration": 10,
		"allow_unconfirmed_inputs": false,
		"bet_type": 2,
		"multisig_dust_size": 7799
	},
	"jsonrpc": "2.0",
	"id": 0
}
  • Gee, it took me a while to find a working method: counterparty-client has several issues here, notably several CLI parameters are passed the wrong way, so they end up completely missing...
  • Below is a working (correct) JSON which can be used to fix the client later.
{
	"method": "create_bet",
	"params": {
		"encoding": "auto",
		"pubkey": ["0265f9763ea8f857571a003a9c7abddc9875a3dd921dbdb15c1659944869f945cd"],
		"dust_return_pubkey": null,
		"op_return_value": 0,
		"fee_per_kb": 25000,
		"feed_address": "mu3FsSTC12dHvUoxr2eEfjmheGRBQZZAdC",
		"source": "n4D7ndiC4yLZxhAf726uMHXC914sEuUAcg",
		"target_value": 1,
		"leverage": 5040,
		"disable_utxo_locks": false,
		"deadline": 1483142340,
		"regular_dust_size": 5429,
		"fee": null,
		"expiration": 10,
		"allow_unconfirmed_inputs": false,
		"bet_type": 2,
		"multisig_dust_size": 7799,
		"wager_quantity": 10000, 
		"counterwager_quantity": 10000
	},
	"jsonrpc": "2.0",
	"id": 0
}

For later reference:

$ sendrawtransaction "0100000001a32bfaf7139dcf7ba01df46d27da28efc73d1587f2c51b187c4466abd27cf205010000006b483045022100e31d6eb835ad7c8f61137000f077eb5011b0ec513feaed32e5adb300f91a27fd02200c8d7d75b06aed8c83e5e0916c4fd11c8be36c08511700b23ff636f96adc830301210265f9763ea8f857571a003a9c7abddc9875a3dd921dbdb15c1659944869f945cdffffffff0335150000000000001976a9149454c911b7016bbd46ecf0911a516dfcec63828b88ac0000000000000000346a32cc36dee446f28935abec0cfd6099d198ac7c42fa5b697033243a95b0b78eee0ce9d866e51bfc94ce2b4383b7bb54fa5e02d5ec2c8d00000000001976a914f8eb547223b286af4c069845bab650951de0ba8988ac00000000"
Hash: fce352bdbfd13f64123ac7085fe94adab0d9653e895a9d0764868f92f9d505cd

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants