zilliqa 0.1.2 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '018bc423c0476dc0362faa4d0df9b4a7f37c4aad76f383bd863fa4100b016b61'
4
- data.tar.gz: d1dfcff519bbd42412f4b14796d70151e09583a63ff4485c16007c0387d6422e
3
+ metadata.gz: 71bba757956cda1651fb68aca99d2ad56b5c4448d8188d8704eb8830b15f560a
4
+ data.tar.gz: e898727b5c67ea2ca0cbf021a10f9363936f28a82bda943ef2174c45cd625881
5
5
  SHA512:
6
- metadata.gz: 11617320444c963cdf226d50c0abe47ed6a6e67e8f99a9300618999975ad1d58656b75d4d2d3544cd02e459290bf486968ae67d8b92cab5a81cba238614cdbed
7
- data.tar.gz: 499f210816b57de86c731100cab5c0ed8b2d89e64339938066527e09818e4789267a4a1a3c32a71817c86d49850c4b87eafaf4b599d6b2d9f4158df7f18a6ca5
6
+ metadata.gz: fa11781f35765054e687f4a4d0632a54dafbaedcb9585cfec5e1a7e62f357300407f73f6ecd530d36d669c9644e5e33a0f73abe6d9493a5e9afb3d4c416e4155
7
+ data.tar.gz: 5392773a506247f687dd2543f04ae633b797371ad29a8f7b3c4336052cfef44765180575c2d213e9028d40df71bc48cf8addcce7a123230e468de5447a446b55
@@ -3,7 +3,6 @@ require 'digest'
3
3
  module Zilliqa
4
4
  module Account
5
5
  class Wallet
6
- MAINNET = 65_537
7
6
 
8
7
  # Takes an array of Account objects and instantiates a Wallet instance.
9
8
  def initialize(provider = nil, accounts = {})
@@ -70,30 +69,6 @@ module Zilliqa
70
69
  @default_account = @accounts[address]
71
70
  end
72
71
 
73
- # to_checksum_address
74
- #
75
- # takes hex-encoded string and returns the corresponding address
76
- #
77
- # @param {string} address
78
- # @returns {string}
79
- def self.to_checksum_address(address)
80
- return Zilliqa::Util::Bech32.from_bech32(address) if Zilliqa::Util::Validator.bech32?(address)
81
- address = address.downcase.gsub('0x', '')
82
-
83
- s1 = Digest::SHA256.hexdigest(Util.decode_hex(address))
84
- v = s1.to_i(base=16)
85
-
86
- ret = ['0x']
87
- address.each_char.each_with_index do |c, idx|
88
- if '1234567890'.include?(c)
89
- ret << c
90
- else
91
- ret << ((v & (2 ** (255 - 6 * idx))) < 1 ? c.downcase : c.upcase)
92
- end
93
- end
94
-
95
- ret.join
96
- end
97
72
 
98
73
  def transfer(to_addr, amount)
99
74
  gas_price = Integer(@provider.GetMinimumGasPrice)
@@ -127,7 +102,7 @@ module Zilliqa
127
102
 
128
103
  def sign_with(tx, address)
129
104
  account = @accounts[address]
130
- address = @provider.testnet? ? Zilliqa::Util::Bech32.from_bech32(account.address) : account.address
105
+ address = account.address
131
106
 
132
107
  raise 'The selected account does not exist on this Wallet instance.' unless account
133
108
 
@@ -28,10 +28,6 @@ module Zilliqa
28
28
  def method_missing(sym, *args)
29
29
  @client.invoke(sym.to_s, args)
30
30
  end
31
-
32
- def testnet?
33
- @endpoint && !@endpoint.match('dev').nil?
34
- end
35
31
  end
36
32
  end
37
33
  end
@@ -1,3 +1,3 @@
1
1
  module Zilliqa
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zilliqa
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - snuff
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2020-07-04 00:00:00.000000000 Z
12
+ date: 2020-07-05 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -196,8 +196,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
196
196
  - !ruby/object:Gem::Version
197
197
  version: '0'
198
198
  requirements: []
199
- rubyforge_project:
200
- rubygems_version: 2.7.10
199
+ rubygems_version: 3.1.4
201
200
  signing_key:
202
201
  specification_version: 4
203
202
  summary: Zilliqa — Zilliqa Ruby Blockchain Library