You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm receiving a "cannot find field 'principal' when I run the below code. It seems like the candid did is incorrect, but I've verified it multiple times. Any suggestions on troubleshooting? Thanks!
--------------------------------CODE---------------------------------
from ic.canister import Canister
from ic.client import Client
from ic.agent import Agent
from ic.candid import encode, decode, Types
from ic.identity import Identity
Hi,
I'm receiving a "cannot find field 'principal' when I run the below code. It seems like the candid did is incorrect, but I've verified it multiple times. Any suggestions on troubleshooting? Thanks!
--------------------------------CODE---------------------------------
from ic.canister import Canister
from ic.client import Client
from ic.agent import Agent
from ic.candid import encode, decode, Types
from ic.identity import Identity
i1 = Identity()
client = Client(url = "https://ic0.app")
agent = Agent(i1, client)
params = []
params = encode(params)
canister_id = 'zqfso-syaaa-aaaaq-aaafq-cai'
response = agent.query_raw(canister_id,'__get_candid_interface_tmp_hack',params)
canister_did = response[0]['value']
canister = Canister(agent=agent, canister_id=canister_id, candid=canister_did)
---------------------------------------ERROR----------------------------------------------------------
Traceback (most recent call last):
File "C:\Users\KyleLangham\PycharmProjects\ICPTransactions\SNS\test.py", line 20, in
my_canister.list_neurons({ 'of_principal': [], 'limit': 1000, 'start_page_at': []})
File "C:\Users\KyleLangham\PycharmProjects\ICPTransactions\venv\lib\site-packages\ic\canister.py", line 57, in call
res = self.agent.query_raw(
File "C:\Users\KyleLangham\PycharmProjects\ICPTransactions\venv\lib\site-packages\ic\agent.py", line 79, in query_raw
return decode(result['reply']['arg'], return_type)
File "C:\Users\KyleLangham\PycharmProjects\ICPTransactions\venv\lib\site-packages\ic\candid.py", line 1297, in decode
'value': t.decodeValue(b, types[i])
File "C:\Users\KyleLangham\PycharmProjects\ICPTransactions\venv\lib\site-packages\ic\candid.py", line 671, in decodeValue
x[expectKey] = exceptValue.decodeValue(b, v)
File "C:\Users\KyleLangham\PycharmProjects\ICPTransactions\venv\lib\site-packages\ic\candid.py", line 552, in decodeValue
rets.append(self._type.decodeValue(b, vec._type))
File "C:\Users\KyleLangham\PycharmProjects\ICPTransactions\venv\lib\site-packages\ic\candid.py", line 859, in decodeValue
return self._type.decodeValue(b, t)
File "C:\Users\KyleLangham\PycharmProjects\ICPTransactions\venv\lib\site-packages\ic\candid.py", line 671, in decodeValue
x[expectKey] = exceptValue.decodeValue(b, v)
File "C:\Users\KyleLangham\PycharmProjects\ICPTransactions\venv\lib\site-packages\ic\candid.py", line 552, in decodeValue
rets.append(self._type.decodeValue(b, vec._type))
File "C:\Users\KyleLangham\PycharmProjects\ICPTransactions\venv\lib\site-packages\ic\candid.py", line 859, in decodeValue
return self._type.decodeValue(b, t)
File "C:\Users\KyleLangham\PycharmProjects\ICPTransactions\venv\lib\site-packages\ic\candid.py", line 674, in decodeValue
raise ValueError("Cannot find field {}".format(keys[idx]))
ValueError: Cannot find field "principal"
Process finished with exit code 1
The text was updated successfully, but these errors were encountered: