Skip to content
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

TxGraph<A> should be able to transform anchor types. #1295

Closed
evanlinjin opened this issue Jan 22, 2024 · 4 comments · Fixed by #1325
Closed

TxGraph<A> should be able to transform anchor types. #1295

evanlinjin opened this issue Jan 22, 2024 · 4 comments · Fixed by #1325
Assignees
Labels
new feature New feature or request
Milestone

Comments

@evanlinjin
Copy link
Member

evanlinjin commented Jan 22, 2024

Describe the enhancement

impl<A1, A2: From<A1>> From<TxGraph<A1>> for TxGraph<A2> {
    // TODO
}

If A2: From<A1> is impossible, we can have a method:

impl<A> TxGraph<A> {
    pub fn map_anchors<A2, F>(self, f: F) -> TxGraph<A2> where F: Fn(A) -> A2 { todo!() }
}

Use case

Some chain source methods return TxGraphs. It will be good to update original TxGraphs with different anchor types.

@evanlinjin evanlinjin added the new feature New feature or request label Jan 22, 2024
@evanlinjin evanlinjin added this to the 1.0.0-beta milestone Jan 22, 2024
@LLFourn
Copy link
Contributor

LLFourn commented Jan 29, 2024

Same as #1096 I think. I closed it since we didn't have a concrete situation to do this. Do we have one now?

@evanlinjin
Copy link
Member Author

@LLFourn I think we need this. There were a couple of times I was like "this functionality would be nice". Otherwise I've been recreating a TxGraph by getting an initial changeset and working from there.

@yanganto
Copy link
Contributor

yanganto commented Feb 6, 2024

I want to try this. 😄

@evanlinjin
Copy link
Member Author

I want to try this. 😄

Go for it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new feature New feature or request
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

4 participants