tencent_trustsql 0.1.4 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +2 -2
- data/README.md +33 -0
- data/lib/tencent_trustsql/api/asset_issue.rb +14 -0
- data/lib/tencent_trustsql/client.rb +3 -2
- data/lib/tencent_trustsql/tools/sign_generator.rb +3 -1
- data/lib/tencent_trustsql/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e0d5b4a45a258e6c8d2d3ab1e468a47e3ae475ac8bd55651df6859e89fb97db1
|
4
|
+
data.tar.gz: 8f61e96fc4fccbe735b4d289b16e1d8d58f9b3b6219bbcaaf14878373f8c6335
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f8fdf7a2ac079a2175b9cfbd1456cfb7cace75f82e2ff7d654b0b5b1c542b0db5df859b39fa63a7d4ab323a51f6e774510234d6c7cbe742cf473fe6c6079db73
|
7
|
+
data.tar.gz: 02dcc5fed2d267ab4e5c9f9b3657a7ce6895c66e8dd15fcf55f59adaa0c892595c473584edad5977905f5efd9264f23525c033cfda8a2b6b1aa0fef2cc830b8c
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -73,3 +73,36 @@ Bug reports and pull requests are welcome on GitHub at https://github.com/[USERN
|
|
73
73
|
|
74
74
|
Everyone interacting in the TencentTrustsql project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/tencent_trustsql/blob/master/CODE_OF_CONDUCT.md).
|
75
75
|
|
76
|
+
### update to 0.1.5
|
77
|
+
|
78
|
+
- Attention
|
79
|
+
|
80
|
+
nested json params
|
81
|
+
|
82
|
+
```json
|
83
|
+
params = {
|
84
|
+
chain_id: 'xxx',
|
85
|
+
"extra_info": {
|
86
|
+
"asset_name": "asset.name",
|
87
|
+
"asset_type": "asset.asset_type",
|
88
|
+
"note": "note 中文",
|
89
|
+
"test_array": [1, 2, "中文 value"],
|
90
|
+
"test_hash": {"k": "v"}
|
91
|
+
}
|
92
|
+
}
|
93
|
+
```
|
94
|
+
|
95
|
+
- New Features
|
96
|
+
|
97
|
+
交易批量查询
|
98
|
+
|
99
|
+
```ruby
|
100
|
+
query_options = {
|
101
|
+
"chain_id": 'ch_tencent_testchain',
|
102
|
+
"page_limit": 3,
|
103
|
+
"transaction_id": 'transaction_id_xxx',
|
104
|
+
"page_no": 1
|
105
|
+
}
|
106
|
+
|
107
|
+
client.trans_batch_query(node_ip, node_port, query_options)
|
108
|
+
```
|
@@ -20,6 +20,20 @@ module TencentTrustsql
|
|
20
20
|
asset_commit_base __method__, node_ip, node_port, options
|
21
21
|
end
|
22
22
|
|
23
|
+
# 交易批量查询
|
24
|
+
# {
|
25
|
+
# "sign_type": "ECDSA",
|
26
|
+
# "chain_id": "chain_id",
|
27
|
+
# "page_limit": 3,
|
28
|
+
# "transaction_id": 'transaction_id'
|
29
|
+
# "page_no": 1
|
30
|
+
# }
|
31
|
+
def trans_batch_query(node_ip, node_port, options={})
|
32
|
+
url = "http://#{node_ip}:#{node_port}/#{__method__}"
|
33
|
+
params = asset_base_params.merge(options)
|
34
|
+
http_post(url,params)
|
35
|
+
end
|
36
|
+
|
23
37
|
def asset_apply_base name, *args
|
24
38
|
url_map = {
|
25
39
|
asset_apply: 'asset_issue_apply',
|
@@ -36,15 +36,16 @@ module TencentTrustsql
|
|
36
36
|
|
37
37
|
def http_post url, params
|
38
38
|
# sign
|
39
|
-
query = TencentTrustsql.params_to_string(params)
|
39
|
+
query = TencentTrustsql.params_to_string(params)
|
40
40
|
mch_sign = TencentTrustsql.output_formatter.out_sign(TencentTrustsql.sign(mch_private_key, query))
|
41
|
-
|
41
|
+
p 'http_post mch_sign used query' + query
|
42
42
|
params.merge!(mch_sign: mch_sign)
|
43
43
|
|
44
44
|
p params
|
45
45
|
p url
|
46
46
|
|
47
47
|
response =HTTP.post(url, json: params)
|
48
|
+
puts response.body
|
48
49
|
JSON.parse(response.body) rescue nil
|
49
50
|
end
|
50
51
|
|
@@ -13,9 +13,11 @@ module TencentTrustsql
|
|
13
13
|
|
14
14
|
def params_to_string items
|
15
15
|
query = items.sort.map do |k, v|
|
16
|
+
v = v.to_json if v.class != String
|
16
17
|
"#{k}=#{v}" if v.to_s != ''
|
17
18
|
end.compact.join('&')
|
18
|
-
|
19
|
+
puts query
|
20
|
+
query
|
19
21
|
end
|
20
22
|
|
21
23
|
def sign private_key, data
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tencent_trustsql
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- jack
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-12-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: http
|