Skip to content

Instantly share code, notes, and snippets.

@plowsof
Created December 7, 2022 02:24
Show Gist options
  • Save plowsof/933ca5fd56f12cd0c0f40bd8a051d693 to your computer and use it in GitHub Desktop.
Save plowsof/933ca5fd56f12cd0c0f40bd8a051d693 to your computer and use it in GitHub Desktop.
create a uri, then parse the uri and compare the response to the original
from monerorpc.authproxy import AuthServiceProxy, JSONRPCException
import uuid
rpc_url = "http://127.0.0.1:18082/json_rpc"
rpc_connection = AuthServiceProxy(service_url=rpc_url)
payments = []
for x in range(500):
data ={
"address": "7A34nZvNrcsfCJYgTEruQdSzgoau8ezFMDo3Ce1wbB9SARucERjWsz7FaSrPRGZqHJY8pScU4hMeHLqMMEGxos3hKFB9EnR",
"amount": random.randint(1, 100),
"recipient_name": uuid.uuid4().hex
}
payments.append(data)
uri = rpc_connection.make_uri({"payments":payments,"tx_description":"wait what?","payment_id":""})
resp_uri = uri["uri"]
resp_json = rpc_connection.parse_uri({"uri":resp_uri})
assert resp_json["uri"]["payments"] == payments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment