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

feat(cheatcodes): access broadcast artifacts #9107

Open
wants to merge 23 commits into
base: master
Choose a base branch
from

Conversation

yash-atreya
Copy link
Member

@yash-atreya yash-atreya commented Oct 14, 2024

Motivation

Builds upon #9098

Closes #4732 + Closes #9083

Solution

// Returns the most recent broadcast for the given contract on `chainId` matching `txType`.
function getBroadcast(string memory contractName, uint64 chainId, BroadcastTxType txType) external returns (BroadcastTxSummary memory);

//  Returns all broadcasts for the given contract on `chainId` with the specified `txType`.
//  Sorted such that the most recent broadcast is the first element, and the oldest is the last. i.e descending order of BroadcastTxSummary.blockNumber.
function getBroadcasts(string memory contractName, uint64 chainId, BroadcastTxType txType) external returns (BroadcastTxSummary[] memory);

// Returns all broadcasts for the given contract on `chainId`.
// Sorted such that the most recent broadcast is the first element, and the oldest is the last. i.e descending order of BroadcastTxSummary.blockNumber.
function getBroadcasts(string memory contractName, uint64 chainId) external returns (BroadcastTxSummary[] memory);
  • Tests

@yash-atreya yash-atreya changed the base branch from master to yash/refac-script-sequence October 14, 2024 13:11
@yash-atreya yash-atreya changed the title Yash/get deployment data feat(cheatcodes): access broadcast artifacts Oct 14, 2024
@yash-atreya yash-atreya marked this pull request as draft October 14, 2024 13:12
@yash-atreya yash-atreya self-assigned this Oct 14, 2024
Base automatically changed from yash/refac-script-sequence to master October 15, 2024 11:06
@yash-atreya yash-atreya marked this pull request as ready for review October 16, 2024 08:56
@yash-atreya yash-atreya marked this pull request as draft October 16, 2024 09:04
@yash-atreya yash-atreya marked this pull request as ready for review October 18, 2024 08:13
}
}

struct BroadcastReader {
Copy link
Collaborator

@grandizzy grandizzy Oct 18, 2024

Choose a reason for hiding this comment

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

I think we should add some comments to struct and functions. Also, would it make sense to move the reader in a common crate so it could also be used from other places, wdyt? (like if we want to provide a cli for broadcast history)

Copy link
Member Author

Choose a reason for hiding this comment

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

This would cause cyclic deps between common and script-seqeunce. I could move it to script-sequence? @grandizzy

Copy link
Collaborator

Choose a reason for hiding this comment

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

ah, I see, I think should work. @klkvr wdyt, would script-sequence be a good place or not worth moving it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Ready For Review
2 participants