-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* MoneyTree from rubygems.org * update demo
- Loading branch information
Showing
4 changed files
with
41 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,4 @@ | ||
source 'https://rubygems.org' | ||
|
||
git_source(:github) {|repo_name| "https://github.com/#{repo_name}" } | ||
|
||
# Specify your gem's dependencies in money-tree.gemspec | ||
gemspec | ||
|
||
gem 'money-tree', :github => 'rusanter/money-tree', :branch => 'thebestcoin' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,48 +1,59 @@ | ||
module MultisigMoneyTree | ||
@@networks = Bitcoin::NETWORKS | ||
@@network = :bitcoin | ||
|
||
# Merge ThiBestCoin networks configuration to Bitcoin gem | ||
begin | ||
@@networks[:bitcoin_testnet] = @@networks[:testnet] | ||
@@networks.merge!( | ||
thebestcoin: @@networks[:bitcoin].merge( | ||
# Merge TheBestCoin network settings to +networks+ settings | ||
def self.merge_thebestcoin(networks) | ||
networks[:bitcoin_testnet] = networks[:testnet] unless networks[:bitcoin_testnet] | ||
networks.merge( | ||
thebestcoin: networks[:bitcoin].merge( | ||
address_version: '0f', | ||
p2sh_version: '12', | ||
p2sh_char: '8', | ||
privkey_version: '60', | ||
privkey_compression_flag: '01', | ||
extended_privkey_version: "05adc3a6", | ||
extended_pubkey_version: "05adb52c", | ||
compressed_wif_chars: %w(c), | ||
uncompressed_wif_chars: %w(G), | ||
protocol_version: 70015 | ||
), | ||
thebestcoin_testnet: @@networks[:bitcoin].merge( | ||
thebestcoin_testnet: networks[:bitcoin].merge( | ||
address_version: '55', | ||
p2sh_version: '57', | ||
p2sh_char: 'c', | ||
privkey_version: '1a', | ||
privkey_compression_flag: '01', | ||
extended_privkey_version: "3f23263a", | ||
extended_pubkey_version: "3f23253b", | ||
compressed_wif_chars: %w(c), | ||
uncompressed_wif_chars: %w(B), | ||
protocol_version: 70015 | ||
) | ||
) | ||
|
||
Bitcoin.send(:remove_const, :NETWORKS) | ||
Bitcoin.const_set(:NETWORKS, @@networks) | ||
Bitcoin.network = @@network | ||
end | ||
# Set network to Bitcoin gem | ||
|
||
# Set network to self and Bitcoin gem | ||
def self.network=(network) | ||
raise Error::NetworkNotFound unless @@networks.key?(network.to_sym) | ||
raise Error::NetworkNotFound, "#{network} is not a valid network!" unless @@network_keys.include?(network.to_sym) | ||
@@network = Bitcoin.network = network.to_sym | ||
end | ||
|
||
# Get current network | ||
def self.network | ||
@@network | ||
end | ||
end | ||
|
||
# Merge ThiBestCoin networks configuration to Bitcoin and MoneyTree gems | ||
begin | ||
money_tree = merge_thebestcoin(MoneyTree::NETWORKS) | ||
bitcoin = merge_thebestcoin(Bitcoin::NETWORKS) | ||
|
||
@@network_keys = bitcoin.keys | ||
@@network = :bitcoin | ||
|
||
MoneyTree.send(:remove_const, :NETWORKS) | ||
MoneyTree.const_set(:NETWORKS, money_tree) | ||
|
||
Bitcoin.send(:remove_const, :NETWORKS) | ||
Bitcoin.const_set(:NETWORKS, bitcoin) | ||
Bitcoin.network = @@network | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
module MultisigMoneyTree | ||
VERSION = "0.1.1".freeze | ||
end | ||
VERSION = "0.1.3".freeze | ||
end |