Skip to content

Commit

Permalink
Fix YAML.load incompatibility introduced in ruby 3.1(by psych v4.0)
Browse files Browse the repository at this point in the history
  • Loading branch information
azuchi committed May 22, 2022
1 parent 80bb047 commit f2b2d64
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/ruby.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,15 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
ruby-version: ["2.5", "2.6", "2.7", "3.0"]
ruby-version: ["2.6", "2.7", "3.0", "3.1"]

steps:
- run: sudo apt install libleveldb-dev
- uses: actions/checkout@v2
- name: Set up Ruby
# To automatically get bug fixes and new Ruby versions for ruby/setup-ruby,
# change this to (see https://github.com/ruby/setup-ruby#versioning):
# uses: ruby/setup-ruby@v1
uses: ruby/setup-ruby@473e4d8fe5dd94ee328fdfca9f8c9c7afc9dae5e
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby-version }}
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
Expand Down
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.0.2
3.1.2
3 changes: 2 additions & 1 deletion lib/tapyrus/chain_params.rb
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ def dev?
end

def self.init(name)
i = YAML.load(File.open("#{__dir__}/chainparams/#{name}.yml"))
yaml = File.open("#{__dir__}/chainparams/#{name}.yml")
i = YAML.respond_to?(:unsafe_load) ? YAML.unsafe_load(yaml) : YAML.load(yaml)
i.dust_relay_fee ||= Tapyrus::DUST_RELAY_TX_FEE
i
end
Expand Down

0 comments on commit f2b2d64

Please sign in to comment.