pochette_toshi 0.1.8 → 0.1.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/pochette_toshi/version.rb +1 -1
- data/lib/pochette_toshi.rb +7 -4
- data/pochette_toshi.gemspec +1 -0
- metadata +16 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9ad624fefb330cf05888df8551fdb67050950f1a
|
4
|
+
data.tar.gz: 445ec4d754a2c48ffb35c0cf90cd5e4d71749a4a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3e72a302dad958328e8c96c7ffcf308ead59d98cf1a9a05a53dd4a5fbaccaf42aaf49b73ce95caa9f24d6eaf09d25faebb1033b6e58665681de92a3d38628e88
|
7
|
+
data.tar.gz: e02e3eee8a8ea0966e30b64df38e361ea46e8cc4683cb13603fafc77d7f199f0d77db3efb02ec25717653c759b3e2d497de60ce0c46a3f41b0587cd87b2b6da9
|
data/lib/pochette_toshi.rb
CHANGED
@@ -2,6 +2,7 @@ require "pochette_toshi/version"
|
|
2
2
|
require "active_support"
|
3
3
|
require "active_support/core_ext"
|
4
4
|
require "pg"
|
5
|
+
require 'sequel'
|
5
6
|
require 'pochette'
|
6
7
|
require 'rest-client'
|
7
8
|
require 'uri'
|
@@ -12,10 +13,10 @@ require 'oj'
|
|
12
13
|
# you can run and assert your changes with a local copy of
|
13
14
|
# a toshi testnet database.
|
14
15
|
class Pochette::Backends::Toshi
|
15
|
-
|
16
|
+
cattr_accessor :db
|
16
17
|
|
17
18
|
def initialize(options)
|
18
|
-
self.
|
19
|
+
self.class.db ||= Sequel.connect(options.merge(adapter: 'postgres'))
|
19
20
|
end
|
20
21
|
|
21
22
|
def incoming_for(addresses, min_date)
|
@@ -211,7 +212,7 @@ class Pochette::Backends::Toshi
|
|
211
212
|
end
|
212
213
|
|
213
214
|
def block_height
|
214
|
-
|
215
|
+
query('select max(height) from blocks where branch = 0')[0][0].to_i
|
215
216
|
end
|
216
217
|
|
217
218
|
def pushtx(hex)
|
@@ -222,7 +223,9 @@ class Pochette::Backends::Toshi
|
|
222
223
|
end
|
223
224
|
|
224
225
|
def query(sql)
|
225
|
-
|
226
|
+
self.db.synchronize do |conn|
|
227
|
+
conn.exec(sql).values
|
228
|
+
end
|
226
229
|
end
|
227
230
|
|
228
231
|
def sanitize_list(list)
|
data/pochette_toshi.gemspec
CHANGED
@@ -19,6 +19,7 @@ Gem::Specification.new do |spec|
|
|
19
19
|
spec.add_dependency "pochette", "~> 0.1.7"
|
20
20
|
spec.add_dependency "pg", "~> 0.17"
|
21
21
|
spec.add_dependency "activesupport", "~> 4.2"
|
22
|
+
spec.add_dependency "sequel", "~> 4.27"
|
22
23
|
spec.add_dependency "rest-client", "~> 1.8.0"
|
23
24
|
|
24
25
|
spec.add_development_dependency "bundler", "~> 1.9"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pochette_toshi
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nubis
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-10-
|
11
|
+
date: 2015-10-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pochette
|
@@ -52,6 +52,20 @@ dependencies:
|
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '4.2'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: sequel
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '4.27'
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '4.27'
|
55
69
|
- !ruby/object:Gem::Dependency
|
56
70
|
name: rest-client
|
57
71
|
requirement: !ruby/object:Gem::Requirement
|