Plutonomicon / cardano-transaction-lib

A Purescript library for building smart contract transactions on Cardano
https://plutonomicon.github.io/cardano-transaction-lib/
MIT License
92 stars 50 forks source link

Add `RefInputUnchecked` that allows referencing only with `TransactionInput` #1519

Closed SeungheonOh closed 1 year ago

SeungheonOh commented 1 year ago

Closes #1518

Pre-review checklist

klntsky commented 1 year ago

Well it does not fix the problem, only propagates it forward. We do need script output to decide if it is native. It works for your case, but will fail for others. We keep this check to fail early, because using a native script with redeemer is an obvious dead end.

I don't see how this approach could work. What's your motivation?

SeungheonOh commented 1 year ago

Liqwid builds a registry for reference scripts, and having registry, we know for a fact that our reference inputs(without txOut resolved) is valid. Having option to use script reference without getting them resolved opens up some room for optimization.

Since the name, RefInputUnchecked, implies that there will be no "checks" I think it's fine to skip check for native script as well

klntsky commented 1 year ago

I think that this functionality is too specific for your use case, it would not make a good API for the rest of the users. You have a registry of (txId, index), just turn it into a registry of full UTxOs.