Skip to content

Commit

Permalink
remove bip_mnemonic dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
Piotr Stachyra committed Sep 26, 2022
1 parent 7da560b commit 8e979b7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
7 changes: 1 addition & 6 deletions helpers/app_helpers.rb
@@ -1,5 +1,3 @@
require 'bip_mnemonic'

module Helpers
module App
def version
Expand Down Expand Up @@ -793,10 +791,7 @@ def prepare_mnemonics(mn)
end

def mnemonic_sentence wc
mtrx = {'9' => 96, '12' => 128, '15' => 164, '18' => 196, '21' => 224, '24' => 256}
wc = wc.to_s
raise "Non-supported no of words #{wc}! Supported are #{mtrx.keys}" unless mtrx.keys.include?(wc)
BipMnemonic.to_mnemonic(bits: mtrx[wc], language: 'english')
@cw.utils.mnemonic_sentence(wc.to_i).join(' ')
end

end
Expand Down
4 changes: 2 additions & 2 deletions views/form_gen_mnemonics.erb
Expand Up @@ -6,10 +6,10 @@
<select class="custom-select mr-sm-2" name="words_count">
<option value="9" <%= "selected" if words_count == '9' %>>9</option>
<option value="12" <%= "selected" if words_count == '12' %>>12</option>
<option value="15" <%= "selected" if words_count == '15' || !words_count %>>15</option>
<option value="15" <%= "selected" if words_count == '15' %>>15</option>
<option value="18" <%= "selected" if words_count == '18' %>>18</option>
<option value="21" <%= "selected" if words_count == '21' %>>21</option>
<option value="24" <%= "selected" if words_count == '24' %>>24</option>
<option value="24" <%= "selected" if words_count == '24'|| !words_count %>>24</option>
</select>
</div>
<div class="col-auto my-1">
Expand Down

0 comments on commit 8e979b7

Please sign in to comment.