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

Add transactional helper #357

Merged
merged 5 commits into from
Jul 28, 2021
Merged

Add transactional helper #357

merged 5 commits into from
Jul 28, 2021

Conversation

ethanfrey
Copy link
Member

Closes #349

@ethanfrey ethanfrey marked this pull request as ready for review July 27, 2021 15:51
@ethanfrey ethanfrey requested review from hashedone and maurolacy July 27, 2021 15:52
Copy link
Contributor

@hashedone hashedone left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I really like how this simplified things. I am concerned about #[allow(dead_code)] - it makes me think that something which should be publicly exposed is not, but I assume it is just because something which would later use those internally is in progress.

@ethanfrey
Copy link
Member Author

Yeah, those are just used in some tests. I guess I could remove or conditionally compile.

@ethanfrey ethanfrey force-pushed the 349-transaction-cleanup branch from 96ed35e to ddc3223 Compare July 28, 2021 13:09
@ethanfrey ethanfrey merged commit dae72a3 into main Jul 28, 2021
@ethanfrey ethanfrey deleted the 349-transaction-cleanup branch July 28, 2021 13:20
let res = action(&mut cache, base)?;
cache.prepare().commit(base);
Ok(res)
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice helper / pattern.

api: self.api.deref(),
querier: QuerierWrapper::new(&querier),
};
action(handler, deps, env)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whoa, one action inside an action.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

multi-test: cleaner use of transactions
3 participants