-
Notifications
You must be signed in to change notification settings - Fork 762
Cleanup X-chain UniqueTx Dependencies #1656
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
Conversation
assets := tx.AssetIDs() | ||
require.Len(assets, 1) | ||
require.Contains(assets, assetID) | ||
|
||
consumedAssets := tx.ConsumedAssetIDs() | ||
require.Len(consumedAssets, 1) | ||
require.Contains(consumedAssets, assetID) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These functions no longer exist
tx0 := &testTx{ | ||
Tx: innerTx0, | ||
tx: tx1, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This updates the dependencies of tx1
to be empty after tx0
is accepted.
@@ -54,26 +54,6 @@ func (t *OperationTx) InputIDs() set.Set[ids.ID] { | |||
return inputs | |||
} | |||
|
|||
// ConsumedAssetIDs returns the IDs of the assets this transaction consumes | |||
func (t *OperationTx) ConsumedAssetIDs() set.Set[ids.ID] { | |||
assets := t.AssetIDs() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was incorrect before. It should have been assets := t.BaseTx.AssetIDs()
.
}) | ||
if inputTx.Status() != choices.Accepted { | ||
txIDs.Add(txID) | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This loop was only needed if someone created a Fx
with an Operation
that could be issued with no Input
UTXO
s. However, no such Fx
was ever added - and so it is safe to remove (as all chains are now linearized).
if tx.Tx == nil || len(tx.deps) != 0 { | ||
return tx.deps, nil | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: tx.Tx
can never be nil
here because MissingDependencies()
is only called from txs
returned from ParseTx
(which can clearly never have a nil
tx.Tx
).
Why this should be merged
Continuing the push to make
UniqueTx
as minimal as possible. Once we removeStatus
es from being persisted my conquest will abide here.How this works
How this was tested