forked from rocklabs-io/ic-py
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test_client.py
33 lines (29 loc) · 1.49 KB
/
test_client.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
from ic.agent import *
from ic.identity import *
from ic.client import *
from ic.candid import Types, encode
client = Client()
canister_id = "gvbup-jyaaa-aaaah-qcdwa-cai"
reqid = b'\xb3\nU\\F\xf9\x9d\x06\xfa\x15\x1aI\x93S\xa9\x8b\xb2\x8a\x03\xd6BJ},\xa5r=\xa9C\x10v\x98'
data = b'\xa3gcontent\xa6lrequest_typedcallfsenderX\x1d\x819\xde\x9e\xc8\x1dP\xd8b\xa9V\xdd\x95\xe8\xd7\x05\xe4b\xf9\xe8\xdf o\xf4\xfeI\x879\x02\
kcanister_idJ\x00\x00\x00\x00\x00\xf0\x10\xec\x01\x01\
kmethod_namehtransfer\
cargODIDL\x00\x02h}\x01\x00\x80\xc8\xaf\xa0%\
ningress_expiry\x1b\x16\xc0Qh\xd1\xba\xf6\x00\
msender_pubkeyX,0*0\x05\x06\x03+ep\x03!\x00\xec\x17+\x93\xad^V;\xf4\x93,p\xe1$P4\xc3Tg\xef.\xfdMd\xeb\xf8\x19h4g\xe2\xbf\
jsender_sigX@\xf1K2\x17*\x87\x10UTDu\x12\x98\xa5\xc4\xab\xe7\xc0\x9a\x1a~\x16\xda\x1d\xdcl\x01\xbc\xe0Bi\xde}^\x9c\xcb\x07 \xd89Z\x97A22V\x0b\x0e\xb5\x7f\xe2\x1bcLJt\xea\x1b\xc4\xac\x00\x96\xb4\x02'
ret = client.call(canister_id, reqid, data)
'''
{
'content':
{'request_type': 'call',
'sender': b'\x819\xde\x9e\xc8\x1dP\xd8b\xa9V\xdd\x95\xe8\xd7\x05\xe4b\xf9\xe8\xdf o\xf4\xfeI\x879\x02',
'canister_id': b'\x00\x00\x00\x00\x00\xf0\x10\xec\x01\x01',
'method_name': 'transfer',
'arg': b'DIDL\x00\x02h}\x01\x00\x80\xc8\xaf\xa0%',
'ingress_expiry': 163929373000000000000
},
'sender_pubkey': b'0*0\x05\x06\x03+ep\x03!\x00\xec\x17+\x93\xad^V;...Md\xeb\xf8\x19h4g\xe2\xbf',
'sender_sig': b'\x95\xb0\xde\x98\r9o\x19\xb8+\xc1\xf5\xdb\x0b\x85\xafSoLD...uu\xfa%\x7f`OP\xdd\x03'
}
'''