Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions .github/workflows/test_n_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,13 @@ concurrency:
jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:

Choose a reason for hiding this comment

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

por qué matrix?

Choose a reason for hiding this comment

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

pqe somos el mejor squad

Copy link
Contributor Author

Choose a reason for hiding this comment

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

chuta, me quede colgado si la pregunta era de verdad o era por la talla...

Contesto igual...

strategy.matrix te permite definir un job que corra multiples veces en pararllelo. Y se puede interpolar valores en el job usando ${{ matrix.<key>}}

En este caso, corremos el mismo job para cada version de ruby, y usamos el valor para decirle a ruby-setup que instale esa version.

Ademas hay un caso expecial en que para ruby 2.7 agregamos otro valor, rubygems: 3.3.22, y usamos ese valor para actualizar ruby gems cuando estamos en el job 2.7

El fail-fast: false es por que en true (default) si uno de los jobs falla, los otros se cancelan.

Con el needs: [test] que hay en el siguiente job, hacemos que tengan que pasar todos los jobs paralalelos de test antes que se ejecute el siguiente

Copy link

@aundurraga aundurraga Apr 16, 2025

Choose a reason for hiding this comment

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

era verdad jajaj

ruby: ['2.7', '3.0', '3.1', '3.2', '3.3', '3.4']
include:
- ruby: '2.7'
rubygems: '3.3.22'
services:
ganache:
image: trufflesuite/ganache-cli:v6.12.2
Expand All @@ -36,8 +43,8 @@ jobs:

- uses: ruby/setup-ruby@v1
with:
ruby-version: '2.7'
rubygems: '3.3.22'
ruby-version: ${{ matrix.ruby }}
rubygems: ${{ matrix.rubygems || '' }}
bundler-cache: true

- name: Run tests
Expand Down
4 changes: 2 additions & 2 deletions etherlite.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Gem::Specification.new do |spec|
spec.add_development_dependency 'guard', '~> 2.14'
spec.add_development_dependency 'guard-rspec', '~> 4.7'
spec.add_development_dependency 'pry'
spec.add_development_dependency 'rake', '~> 10.0'
spec.add_development_dependency 'rake', '~> 13.0'
spec.add_development_dependency 'rspec', '~> 3.0'
spec.add_development_dependency 'webmock', '~> 3.7.5'
spec.add_development_dependency 'webmock', '~> 3.7'
end
2 changes: 1 addition & 1 deletion lib/etherlite/account/local.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def build_params_from_options(_opt)

def send_transaction_with_passphrase(_params, _passphrase)
if _passphrase.nil?
@connection.eth_send_transaction _params
@connection.eth_send_transaction **_params
else
@connection.personal_send_transaction _params, _passphrase
end
Expand Down
2 changes: 1 addition & 1 deletion lib/etherlite/account/private_key.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ def initialize(_connection, _pk)
end

def build_raw_transaction(_options = {})
nonce = nonce_manager.next_nonce_for(normalized_address, _options.slice(:replace, :nonce))
nonce = nonce_manager.next_nonce_for(normalized_address, **_options.slice(:replace, :nonce))

tx = Eth::Tx.new(
chain_id: @connection.chain_id,
Expand Down
2 changes: 1 addition & 1 deletion lib/etherlite/nonce_manager.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def next_nonce_for(_normalized_address, replace: false, nonce: nil)

def with_next_nonce_for(_normalized_address, _options = {})
@@nonce_mutex.synchronize do
nonce = next_nonce_for(_normalized_address, _options)
nonce = next_nonce_for(_normalized_address, **_options)

begin
result = yield nonce
Expand Down