Adds two methods & miscellaneous clean up. Update to Ruby 3.2.10#25
Adds two methods & miscellaneous clean up. Update to Ruby 3.2.10#25
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the solana_rpc_ruby gem's RPC method coverage and fixes request compatibility issues in MethodsWrapper. It bumps Ruby to 3.2.10, corrects camelCase parameter key names that were previously using snake_case (which would be rejected by the Solana RPC server), fixes the positional placement of the epoch parameter in getLeaderSchedule, and adds two new RPC methods. Request payload compatibility specs are added to lock in the correct wire format.
Changes:
- Fixes RPC request parameter serialization for
getLeaderSchedule,getSupply,getVoteAccounts, andsendTransaction(snake_case → camelCase keys, andepochas positional param) - Adds two new HTTP RPC methods:
get_recent_prioritization_feesandget_stake_minimum_delegation, with accompanying request payload specs - Updates Ruby version to 3.2.10, bumps gem dependencies, and expands README method inventory
Reviewed changes
Copilot reviewed 8 out of 9 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
lib/solana_rpc_ruby/methods_wrapper.rb |
Fixes parameter key names and epoch positioning; adds two new RPC methods |
spec/lib/solana_rpc_ruby/methods_wrapper_spec.rb |
Adds request payload compatibility specs for fixed and new methods |
spec/spec_helper.rb |
Moves ENV assignments before require_relative to ensure correct boot ordering |
README.md |
Updates Solana docs URL, Ruby version requirement, adds method inventories |
doc/method_list.html |
Inserts the two new methods into the HTML method list |
doc/SolanaRpcRuby/MethodsWrapper.html |
Adds placeholder anchor divs for the two new methods |
Gemfile.lock |
Bumps all dependency versions to latest compatible releases |
.ruby-version |
Bumps from 3.1.4 to 3.2.10 |
.github/workflows/specs.yml |
Drops Ruby 3.1 from CI matrix, keeping only 3.2 |
Comments suppressed due to low confidence (1)
doc/method_list.html:565
- After inserting the two new entries (
get_recent_prioritization_feesat line 478 andget_stake_minimum_delegationat line 549), the odd/even CSS class alternation becomes inconsistent. Specifically,get_recent_performance_samples(line 486) isevenand the next entryget_signature_statuses(line 494) is alsoeven, and similarlyget_supply(line 557) andget_token_account_balance(line 565) are botheven. These should alternate. Since this file is generated by YARD, it should be fully regenerated rather than manually patched, which would also fix this inconsistency.
<li class="even ">
<div class="item">
<span class='object_link'><a href="SolanaRpcRuby/MethodsWrapper.html#get_recent_performance_samples-instance_method" title="SolanaRpcRuby::MethodsWrapper#get_recent_performance_samples (method)">#get_recent_performance_samples</a></span>
<small>SolanaRpcRuby::MethodsWrapper</small>
</div>
</li>
<li class="even ">
<div class="item">
<span class='object_link'><a href="SolanaRpcRuby/MethodsWrapper.html#get_signature_statuses-instance_method" title="SolanaRpcRuby::MethodsWrapper#get_signature_statuses (method)">#get_signature_statuses</a></span>
<small>SolanaRpcRuby::MethodsWrapper</small>
</div>
</li>
<li class="odd ">
<div class="item">
<span class='object_link'><a href="SolanaRpcRuby/MethodsWrapper.html#get_signatures_for_address-instance_method" title="SolanaRpcRuby::MethodsWrapper#get_signatures_for_address (method)">#get_signatures_for_address</a></span>
<small>SolanaRpcRuby::MethodsWrapper</small>
</div>
</li>
<li class="even ">
<div class="item">
<span class='object_link'><a href="SolanaRpcRuby/MethodsWrapper.html#get_slot-instance_method" title="SolanaRpcRuby::MethodsWrapper#get_slot (method)">#get_slot</a></span>
<small>SolanaRpcRuby::MethodsWrapper</small>
</div>
</li>
<li class="odd ">
<div class="item">
<span class='object_link'><a href="SolanaRpcRuby/MethodsWrapper.html#get_slot_leader-instance_method" title="SolanaRpcRuby::MethodsWrapper#get_slot_leader (method)">#get_slot_leader</a></span>
<small>SolanaRpcRuby::MethodsWrapper</small>
</div>
</li>
<li class="even ">
<div class="item">
<span class='object_link'><a href="SolanaRpcRuby/MethodsWrapper.html#get_slot_leaders-instance_method" title="SolanaRpcRuby::MethodsWrapper#get_slot_leaders (method)">#get_slot_leaders</a></span>
<small>SolanaRpcRuby::MethodsWrapper</small>
</div>
</li>
<li class="odd deprecated">
<div class="item">
<span class='object_link'><a href="SolanaRpcRuby/MethodsWrapper.html#get_snapshot_slot-instance_method" title="SolanaRpcRuby::MethodsWrapper#get_snapshot_slot (method)">#get_snapshot_slot</a></span>
<small>SolanaRpcRuby::MethodsWrapper</small>
</div>
</li>
<li class="even ">
<div class="item">
<span class='object_link'><a href="SolanaRpcRuby/MethodsWrapper.html#get_stake_activation-instance_method" title="SolanaRpcRuby::MethodsWrapper#get_stake_activation (method)">#get_stake_activation</a></span>
<small>SolanaRpcRuby::MethodsWrapper</small>
</div>
</li>
<li class="odd ">
<div class="item">
<span class='object_link'><a href="SolanaRpcRuby/MethodsWrapper.html#get_stake_minimum_delegation-instance_method" title="SolanaRpcRuby::MethodsWrapper#get_stake_minimum_delegation (method)">#get_stake_minimum_delegation</a></span>
<small>SolanaRpcRuby::MethodsWrapper</small>
</div>
</li>
<li class="even ">
<div class="item">
<span class='object_link'><a href="SolanaRpcRuby/MethodsWrapper.html#get_supply-instance_method" title="SolanaRpcRuby::MethodsWrapper#get_supply (method)">#get_supply</a></span>
<small>SolanaRpcRuby::MethodsWrapper</small>
</div>
</li>
<li class="even ">
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
| params_hash['commitment'] = commitment unless blank?(commitment) | ||
|
|
||
| params << epoch unless epoch.nil? | ||
| params << params_hash unless params_hash.empty? |
There was a problem hiding this comment.
When epoch is nil but identity or commitment are provided, the current code sends [{"identity": "...", "commitment": "..."}] as params. According to the Solana RPC spec for getLeaderSchedule, the first positional parameter is the optional epoch slot (u64 | undefined), and the second is the config object. Passing only [{config}] without a leading null means the server may reject the request or interpret the config hash as the epoch value. To correctly omit epoch while still passing config, null should be prepended: [null, {config}].
| params << params_hash unless params_hash.empty? | |
| unless params_hash.empty? | |
| params << nil if epoch.nil? | |
| params << params_hash | |
| end |
README.md
Outdated
| `get_recent_performance_samples`, `get_signatures_for_address`, `get_signature_statuses`, `get_slot`, | ||
| `get_slot_leader`, `get_slot_leaders`, `get_stake_activation`, `get_stake_minimum_delegation`, `get_supply`, | ||
| `get_token_account_balance`, `get_token_accounts_by_delegate`, `get_token_accounts_by_owner`, | ||
| `get_token_largest_accounts`, `get_token_supply`, `get_transaction`, `get_transaction_count`, `get_version`, | ||
| `get_vote_accounts`, `is_blockhash_valid`, `minimum_ledger_slot`, `request_airdrop`, `send_transaction`, | ||
| `simulate_transaction`, `get_recent_prioritization_fees`. |
There was a problem hiding this comment.
The method get_recent_prioritization_fees is appended at the end of the HTTP methods list, after simulate_transaction, breaking the alphabetical ordering of the rest of the list. It should be placed between get_recent_performance_samples and get_signatures_for_address to maintain the alphabetical order used for all other methods.
| `get_recent_performance_samples`, `get_signatures_for_address`, `get_signature_statuses`, `get_slot`, | |
| `get_slot_leader`, `get_slot_leaders`, `get_stake_activation`, `get_stake_minimum_delegation`, `get_supply`, | |
| `get_token_account_balance`, `get_token_accounts_by_delegate`, `get_token_accounts_by_owner`, | |
| `get_token_largest_accounts`, `get_token_supply`, `get_transaction`, `get_transaction_count`, `get_version`, | |
| `get_vote_accounts`, `is_blockhash_valid`, `minimum_ledger_slot`, `request_airdrop`, `send_transaction`, | |
| `simulate_transaction`, `get_recent_prioritization_fees`. | |
| `get_recent_performance_samples`, `get_recent_prioritization_fees`, `get_signatures_for_address`, `get_signature_statuses`, `get_slot`, | |
| `get_slot_leader`, `get_slot_leaders`, `get_stake_activation`, `get_stake_minimum_delegation`, `get_supply`, | |
| `get_token_account_balance`, `get_token_accounts_by_delegate`, `get_token_accounts_by_owner`, | |
| `get_token_largest_accounts`, `get_token_supply`, `get_transaction`, `get_transaction_count`, `get_version`, | |
| `get_vote_accounts`, `is_blockhash_valid`, `minimum_ledger_slot`, `request_airdrop`, `send_transaction`, | |
| `simulate_transaction`. |
| <div id="get_recent_prioritization_fees-instance_method"></div> | ||
| <div id="get_stake_minimum_delegation-instance_method"></div> |
There was a problem hiding this comment.
The new methods get_recent_prioritization_fees and get_stake_minimum_delegation are only added as empty anchor <div> elements (with no method signature, description, parameter documentation, or source code listing) rather than as full YARD-generated method entries. All other methods in this file (e.g. simulate_transaction ending at line 9074) have complete generated documentation including signatures, docstrings, parameter tables, and source code. These stubs will produce broken or missing links in the method list HTML and will not render any documentation for these methods. The YARD docs should be fully regenerated to include proper entries for the two new methods.
| <div id="get_recent_prioritization_fees-instance_method"></div> | |
| <div id="get_stake_minimum_delegation-instance_method"></div> |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 31 out of 34 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (1)
doc/SolanaRpcRuby/MethodsWrapper.html:5086
- The generated HTML documentation for
get_leader_scheduleindoc/SolanaRpcRuby/MethodsWrapper.htmlshows an outdated/incomplete version of the source code. It displays:
params << epoch unless epoch.nil?
params << params_hash unless params_hash.empty?
But the actual implementation in lib/solana_rpc_ruby/methods_wrapper.rb uses a different, more complex control flow with unless params_hash.empty? wrapping both the params << nil if epoch.nil? and params << params_hash lines. The doc HTML should be regenerated to reflect the actual source code.
<span class='id identifier rubyid_params_hash'>params_hash</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>commitment</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_commitment'>commitment</span> <span class='kw'>unless</span> <span class='id identifier rubyid_blank?'>blank?</span><span class='lparen'>(</span><span class='id identifier rubyid_commitment'>commitment</span><span class='rparen'>)</span>
<span class='id identifier rubyid_params'>params</span> <span class='op'><<</span> <span class='id identifier rubyid_epoch'>epoch</span> <span class='kw'>unless</span> <span class='id identifier rubyid_epoch'>epoch</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
<span class='id identifier rubyid_params'>params</span> <span class='op'><<</span> <span class='id identifier rubyid_params_hash'>params_hash</span> <span class='kw'>unless</span> <span class='id identifier rubyid_params_hash'>params_hash</span><span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</span>
<span class='id identifier rubyid_body'>body</span> <span class='op'>=</span> <span class='id identifier rubyid_create_json_body'>create_json_body</span><span class='lparen'>(</span><span class='id identifier rubyid_method'>method</span><span class='comma'>,</span> <span class='label'>method_params:</span> <span class='id identifier rubyid_params'>params</span><span class='rparen'>)</span>
<span class='id identifier rubyid_send_request'>send_request</span><span class='lparen'>(</span><span class='id identifier rubyid_body'>body</span><span class='comma'>,</span> <span class='id identifier rubyid_http_method'>http_method</span><span class='rparen'>)</span>
<span class='kw'>end</span></pre>
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 31 out of 34 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
| <span class='id identifier rubyid_params'>params</span> <span class='op'><<</span> <span class='id identifier rubyid_epoch'>epoch</span> <span class='kw'>unless</span> <span class='id identifier rubyid_epoch'>epoch</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span> | ||
| <span class='id identifier rubyid_params'>params</span> <span class='op'><<</span> <span class='id identifier rubyid_params_hash'>params_hash</span> <span class='kw'>unless</span> <span class='id identifier rubyid_params_hash'>params_hash</span><span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</span> |
There was a problem hiding this comment.
The generated HTML documentation for get_leader_schedule in doc/SolanaRpcRuby/MethodsWrapper.html (lines 5080–5081) does not include the unless params_hash.empty? block with the params << nil if epoch.nil? insertion that was added to methods_wrapper.rb. Instead, the doc shows the simpler two-line form without the nil-insertion logic. The documentation appears to have been generated from a different version of the code than what was actually committed — the HTML doc should be regenerated from the final methods_wrapper.rb to keep it in sync.
| it 'supports getRecentPrioritizationFees' do | ||
| wrapper.get_recent_prioritization_fees(['11111111111111111111111111111111']) | ||
|
|
||
| expect(captured_request.dig(:body, 'method')).to eq('getRecentPrioritizationFees') | ||
| expect(captured_request.dig(:body, 'params')).to eq([['11111111111111111111111111111111']]) | ||
| end |
There was a problem hiding this comment.
The test description for get_recent_prioritization_fees at line 1375 uses the vague pattern 'supports getRecentPrioritizationFees', inconsistent with every other test in this new describe block which uses an action-oriented format like 'sends getRecentPrioritizationFees with ...'. A more descriptive name like 'sends getRecentPrioritizationFees with addresses param' would improve readability and consistency.
| it 'supports getStakeMinimumDelegation' do | ||
| wrapper.get_stake_minimum_delegation(commitment: 'finalized') | ||
|
|
||
| expect(captured_request.dig(:body, 'method')).to eq('getStakeMinimumDelegation') | ||
| expect(captured_request.dig(:body, 'params')).to eq([{ 'commitment' => 'finalized' }]) | ||
| end |
There was a problem hiding this comment.
The test description for get_stake_minimum_delegation at line 1382 uses the vague pattern 'supports getStakeMinimumDelegation', inconsistent with the other tests in the same describe block that use a more explicit format (e.g., 'sends getStakeMinimumDelegation with commitment param').
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 32 out of 35 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Summary
This PR updates Solana RPC method coverage and request compatibility in MethodsWrapper, and refreshes documentation/method inventories.
RPC compatibility fixes
Fixed get_leader_schedule request shape to send epoch as the first positional param (instead of inside config).
Fixed get_supply request key to excludeNonCirculatingAccountsList.
Fixed get_vote_accounts request keys to:
Fixed send_transaction request key from max_retries to maxRetries.
Added missing HTTP RPC methods
Added get_recent_prioritization_fees(addresses = [])
Added get_stake_minimum_delegation(commitment: nil)
Tests
Added request payload compatibility specs that assert exact outgoing JSON-RPC method names and params for:
Updated test boot ordering in spec/spec_helper.rb so RAILS_ENV=test is set before loading dummy Rails environment.
Documentation
Added explicit method inventories in README.md:
Updated generated docs method index to include:
Validation
bundle exec rspec passes: 146 examples, 0 failures, 25 pending (existing skipped tests).