Closed letmejustputthishere closed 1 year ago
type Transaction = record {
memo : Memo;
// Optional to support potential future variant extensions.
operation : opt Operation;
created_at_time : Timestamp;
};
For operation, it should be operation: Operation
, without opt
. You can refer to archive implmentation to check the type of GetBlocksResult
.
But don't know why dfx still can parse it.
For operation, it should be operation: Operation, without opt. You can refer to archive implmentation to check the type of GetBlocksResult.
No, the opt
part is intentional. We don't want to break all clients when we add new transaction types.
But don't know why dfx still can parse it.
Because T <: opt T
according to the Candid spec.
not (null <: <datatype'>)
<datatype> <: <datatype'>
-----------------------------
<datatype> <: opt <datatype'>
My hunch is that the custom candid parser you use for Python does not handle subtype checks. Consider testing it for compliance against the Candid test suite: https://github.com/dfinity/candid/tree/master/test.
My hunch is that the custom candid parser you use for Python does not handle subtype checks.
Correct, we haven't handle subtype checks so far. So I suggest that to use the fully matched candid file first to get the result of query or async call.
At least for this case, remove the opt
would get the correct result.
Consider testing it for compliance against the Candid test suite: https://github.com/dfinity/candid/tree/master/test.
Thanks for suggestion.
It's not possible to read the response from the ledger archive due to a bug when decoding the response. Minimum example:
More info can be found in this thread
https://forum.dfinity.org/t/how-to-use-dfx-to-query-the-balance-of-an-account-identifier/15929/5?u=cryptoschindler