Psychedelic / dank

Dank - The Internet Computer Decentralized Bank - A collection of Open Internet Services - Including the Cycles Token (XTC)
GNU General Public License v3.0
58 stars 27 forks source link

Type mismatch in XTC mint function Result #58

Open tarek-eg opened 2 years ago

tarek-eg commented 2 years ago

Hello, There's a mismatch in theTxReceipt of the mint function between the candid and the rust implementation In Rust it's Nat and in candid it's Nat64

candid

type MintResult = variant {
    Ok : TransactionId;
    Err: MintError;
};
type TransactionId = nat64;

https://github.com/Psychedelic/dank/blob/965e3dfea7788ed71078849b864d030f547cc215/candid/xtc.did#L59

Rust implementation

pub type TxReceipt = Result<Nat, TxError>;

https://github.com/Psychedelic/dank/blob/f80e1e419029cd6d4e8df3069694df226c731784/xtc/src/ledger.rs#L310

tarek-eg commented 2 years ago

This is causing an issue when I try to decode it using agentjs IDL.decode type mismatch: type on the wire nat, expect type nat64