Repository navigation
Conversation
Two models of a transaction output are public from the entry point under names that give no hint which is which: this one (`address: AddressEras`, `amount: Value`, a Shelley and a Babbage class) and `TxOut` (`address: Address`, `assets: Assets`, one class for both eras), which is what `TransactionBody`, the builders and the sdk take. They reject each other, and the error says `Expected TransactionOutput, actual [toString threw]` about a value that IS a `TransactionOutput` -- the other one. Deprecation rather than removal or an alias: every caller holding a `BabbageTransactionOutput` keeps working, and new code is pointed at `TxOut`. The test pins the claim the note makes.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
One of the four fixes asked for in the closing comment on
#619 — deprecation, not an alias, so nothing
breaks.
The problem
Two models of a transaction output are public from the entry point under names that give no hint
which is which:
TransactionOutputTxOutAddressErasAddressamount: Valueassets: AssetsTransactionBody, the builders, the sdkThey reject each other, and the error says
Expected TransactionOutput, actual [toString threw]about a value that is a
TransactionOutput— the other one.Contents
packages/evolution/src/TransactionOutput.ts—@deprecatedon the module and both classes,pointing at
TxOut. No removal, no re-point, no alias: every caller holding aBabbageTransactionOutputkeeps working, and new code is pointed the right way.packages/evolution/test/TransactionOutput.deprecated.test.ts— pins the claim the note makes,so it cannot quietly stop being true.
changes documentation, not behaviour, and the test is a regression pin on the rejection, not a
demonstration of a fix.
Verification
All six CI tasks run locally off
ci.ymlagainst this base (lint,type-check,test,build,check:dts,docgen): green.packages/evolution: 1916 passed, 75 skipped, 0 failed.devnet's suite needs Docker and was not run here.