New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Inputs do not conform to this spec or are otherwise invalid #71
Comments
When doing the following:
It gives the error: Uncaught (in promise) Deserialization failed in Transaction.witness_set.TransactionWitnessSet because: Invalid cbor: not the right type, expected |
The raw transaction coming from the cardano-cli does not follow the ledger specs actually. That's why Nami is complaining or better said the serialization-lib. You need to transform the cbor code a little bit. Get rid of the empty arrays at the top and replace them with a map and remove the bool in case there is one. |
OK, so it's possible to build an alonzo-era transaction and sign it with Nami? I'm looking for a way to enable smart contracts in my dApp without waiting for the PAB release |
Yes it's possible. I'll release a new Nami version soon, that also handles the additional bool in the transaction from the cardano-cli |
Yes, given that the PAB will be here in a few weeks, should the link handler be implemented in Nami? Or the dApp connector is made with the serialization lib? |
Yeah Nami is fully built on top of the serialization-lib. I currently use a customized version of the serialization-lib, which follows the latest specs: https://github.com/input-output-hk/cardano-ledger-specs/blob/master/eras/alonzo/test-suite/cddl-files/alonzo.cddl |
What is the bool thing about? |
Oh, and where can I contact you about SpaceBudz? I tried to reach you on Discord, but you must have your dms off. |
I think it's an extra flag that tells if the contract evaluates to true or false. I don't know exactly the purpose of it. |
Yeah I'm trying to avoid some platforms atm. You can reach me on telegram @berry_ales |
I created a public toSpec(txFilePath: string): string {
const file = JSON.parse(readFileSync(txFilePath, 'utf-8'));
const { cborHex } = file;
const decoded = cbor.decode(cborHex);
const newCborDecoded = [];
for (let i of decoded) {
if (Array.isArray(i)) {
newCborDecoded.push(new Map());
} else if (typeof i !== 'boolean') {
newCborDecoded.push(i);
}
}
const result = cbor.encode(newCborDecoded).toString('hex');
return result;
} |
This is all good until you actually have some data in those arrays that needs to be transformed. Did you by any chance come up with a way to transform arrays to maps properly? |
No, I migrated to the serialization lib because the interaction was easier. |
I'm getting this error when trying to sign the simplest transaction:
It's an alonzo-era transaction
The text was updated successfully, but these errors were encountered: