Skip to content

Add t2 rpc methods #50

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Conversation

adpthegreat
Copy link

Closes #15

  • getTransactionCount has been implemented already

  • getRecentPerformance_samples has been implemented already

  • getSupply Done

  • getFirstAvailableBlock Done

  • getBlockTime Done

  • getBlock Done

  • getEpochSchedule

Was seeing some comments -> // TODO: Refactor agave-validator wait-for-restart-window to not require this method, so // it can be removed from rpc_minimal does it affect get_epoch_schedule too? I should just write the method using the rpc_client ?

Also, writing the tests is a bit tricky, I just hardcoded the assertions against my local validator values, but I confirmed that the rpc client methods work

Please review @lgalabru

@lgalabru
Copy link
Member

Thanks so much for the PR @adpthegreat, this looks super promising!
Review coming your way today/tomorrow!

.map_err(|err| Error::invalid_params(format!("failed to get supply: {err:?}")));

response
}
Copy link
Member

Choose a reason for hiding this comment

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

I believe we should first be checking if we have something locally, then fallback on fetching remote if we have nothing in our cache. Does that make sense?
Feel free to ping me on TG if you think a chat convo can help you build context faster!

Copy link
Author

Choose a reason for hiding this comment

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

Yeah i just sent a message, found you on that solana devex telegram gc

};

println!("this is the supply {:?}", res); //works
assert_eq!(res, expected_response);
Copy link
Member

Choose a reason for hiding this comment

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

Love the tests thanks!

@adpthegreat
Copy link
Author

Also @lgalabru i want to hear your thoughts on the get_epoch_schedule and the comment i made

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.

RPC Methods to implement - T2: compatibility with explorers
2 participants