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

added mock client and consensus state #27

Merged
merged 16 commits into from
Oct 13, 2023
Merged

added mock client and consensus state #27

merged 16 commits into from
Oct 13, 2023

Conversation

dhruvja
Copy link
Collaborator

@dhruvja dhruvja commented Oct 13, 2023

I have added mock client and consensus state so that we can test it using mocks.

But this would require the mocks and std feature to be used.

@dhruvja dhruvja marked this pull request as draft October 13, 2023 08:07
@dhruvja dhruvja requested a review from mina86 October 13, 2023 08:07
@mina86
Copy link
Collaborator

mina86 commented Oct 13, 2023

FYI,

cargo +nightly fmt

For formatting. Dunno, maybe using nightly formatter features wasn’t the best idea, but for now that’s what we’re using I guess. ;)

@dhruvja
Copy link
Collaborator Author

dhruvja commented Oct 13, 2023

FYI,

cargo +nightly fmt

For formatting.

haha, was just wondering why cargo fmt wasnt working lol

@mina86
Copy link
Collaborator

mina86 commented Oct 13, 2023

LGTM, I just wonder, how convoluted it would be to add mocks feature to the code. Adding #[cfg(feature = "mocks")] everywhere is a bit noisy but on the other hand having mock code in production program isn’t the best idea either.

@dhruvja
Copy link
Collaborator Author

dhruvja commented Oct 13, 2023

LGTM, I just wonder, how convoluted it would be to add mocks feature to the code. Adding #[cfg(feature = "mocks")] everywhere is a bit noisy but on the other hand having mock code in production program isn’t the best idea either.

We could add it as a feature ( dont know how complicated it might be ), but i think we should focus on having a working program first. What do u think?

@mina86
Copy link
Collaborator

mina86 commented Oct 13, 2023

It shouldn't really be complicated. Just add mocks feature to Cargo.toml and then bunch of conditional compilation in the code. Though I admit that I don’t really understand how programs ids work and that could be an issue especially in the Anchor.toml file I suppose.

But yes, overall LGTM.

@dhruvja
Copy link
Collaborator Author

dhruvja commented Oct 13, 2023

It shouldn't really be complicated. Just add mocks feature to Cargo.toml and then bunch of conditional compilation in the code. Though I admit that I don’t really understand how programs ids work and that could be an issue especially in the Anchor.toml file I suppose.

But yes, overall LGTM.

Program ids are just identifiers.
I am getting some vague errors atm. Once i fix that i can try out the mocks feature.

@dhruvja dhruvja requested a review from mina86 October 13, 2023 17:12
@dhruvja dhruvja marked this pull request as ready for review October 13, 2023 17:20
@dhruvja dhruvja merged commit 13ac224 into master Oct 13, 2023
4 checks passed
@dhruvja dhruvja deleted the fix-ibc-test branch October 13, 2023 18:05
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.

2 participants