cardano_wallet 0.1.7 → 0.1.8
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 +4 -4
- data/.github/workflows/nightly.yml +4 -4
- data/.github/workflows/tests.yml +2 -2
- data/docker-compose-shelley.yml +2 -2
- data/lib/cardano_wallet/shelley.rb +29 -12
- data/lib/cardano_wallet/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: ebc7d4ddc02947d49ab653cfc6e1a86a09ff4e8cf7efb33921a1418a855dc68a
|
4
|
+
data.tar.gz: 187877c6fe0fa07d231676f2140a93e30bf2934e325fa9761df63e72a3c85476
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f4956699eb0dc284137b84f7aa53bc38f2fd6b7bed5e0f7793d6c4ec30b692f3f45160db173c175a2421cc889bb2d1d5861c7c5431dd1f924f38fb3d2e7245a2
|
7
|
+
data.tar.gz: d0d63600ec42d8b59fb4f6f5bdf29e88c5e7aa42209b854d5a3da3cea84994f93dd3df5165ae46dd89ec1581137e7f6dfec779fb8d5b1e5fb1b114be548055c5
|
@@ -12,7 +12,7 @@ jobs:
|
|
12
12
|
steps:
|
13
13
|
- uses: actions/checkout@v2
|
14
14
|
- name: Set up cardano-wallet
|
15
|
-
run: NODE_CONFIG_PATH=`pwd`/spec/
|
15
|
+
run: NODE_CONFIG_PATH=`pwd`/spec/testnet docker-compose -f docker-compose-shelley.yml up --detach
|
16
16
|
- name: Set up Ruby
|
17
17
|
# To automatically get bug fixes and new Ruby versions for ruby/setup-ruby,
|
18
18
|
# change this to (see https://github.com/ruby/setup-ruby#versioning):
|
@@ -24,11 +24,11 @@ jobs:
|
|
24
24
|
run: bundle install
|
25
25
|
- name: Wait until node is synced
|
26
26
|
run: bundle exec rake wait_until_node_synced
|
27
|
-
- name: Run all tests
|
28
|
-
run: bundle exec rspec
|
27
|
+
- name: Run all tests (temporarily without nightly)
|
28
|
+
run: bundle exec rspec . -t ~nightly
|
29
29
|
env:
|
30
30
|
CI: true
|
31
31
|
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|
32
32
|
NETWORK: testnet
|
33
33
|
WALLET: dev-master-shelley
|
34
|
-
NODE:
|
34
|
+
NODE: 1.18.0
|
data/.github/workflows/tests.yml
CHANGED
@@ -21,7 +21,7 @@ jobs:
|
|
21
21
|
steps:
|
22
22
|
- uses: actions/checkout@v2
|
23
23
|
- name: Set up cardano-wallet
|
24
|
-
run: NODE_CONFIG_PATH=`pwd`/spec/
|
24
|
+
run: NODE_CONFIG_PATH=`pwd`/spec/testnet docker-compose -f docker-compose-shelley.yml up --detach
|
25
25
|
- name: Set up Ruby
|
26
26
|
# To automatically get bug fixes and new Ruby versions for ruby/setup-ruby,
|
27
27
|
# change this to (see https://github.com/ruby/setup-ruby#versioning):
|
@@ -38,4 +38,4 @@ jobs:
|
|
38
38
|
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|
39
39
|
NETWORK: testnet
|
40
40
|
WALLET: dev-master-shelley
|
41
|
-
NODE:
|
41
|
+
NODE: 1.18.0
|
data/docker-compose-shelley.yml
CHANGED
@@ -7,7 +7,7 @@ services:
|
|
7
7
|
- node-db:/data
|
8
8
|
- node-ipc:/ipc
|
9
9
|
- ${NODE_CONFIG_PATH}:/config
|
10
|
-
command: run --socket-path /ipc/node.socket --config /config
|
10
|
+
command: run --socket-path /ipc/node.socket --config /config/${NETWORK}-config.json --topology /config/${NETWORK}-topology.json --database-path /data
|
11
11
|
restart: on-failure
|
12
12
|
|
13
13
|
cardano-wallet:
|
@@ -18,7 +18,7 @@ services:
|
|
18
18
|
- ${NODE_CONFIG_PATH}:/config
|
19
19
|
ports:
|
20
20
|
- 8090:8090
|
21
|
-
command: serve --testnet /config
|
21
|
+
command: serve --testnet /config/${NETWORK}-byron-genesis.json --node-socket /ipc/node.socket --database /wallet-db --listen-address 0.0.0.0
|
22
22
|
restart: on-failure
|
23
23
|
|
24
24
|
volumes:
|
@@ -195,17 +195,26 @@ module CardanoWallet
|
|
195
195
|
# @param wid [String] source wallet id
|
196
196
|
# @param passphrase [String] source wallet's passphrase
|
197
197
|
# @param payments [Hash] addres, amount pair
|
198
|
-
# @param
|
198
|
+
# @param withdrawal [Strin or Array] 'self' or mnemonic sentence
|
199
199
|
#
|
200
200
|
# @example
|
201
|
-
# create(wid, passphrase, {addr1: 1000000},
|
202
|
-
def create(wid, passphrase, payments,
|
201
|
+
# create(wid, passphrase, {addr1: 1000000}, 'self')
|
202
|
+
def create(wid, passphrase, payments, withdrawal = nil)
|
203
203
|
payments_formatted = Utils.format_payments(payments)
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
204
|
+
|
205
|
+
if withdrawal
|
206
|
+
payload = { :payments => payments_formatted,
|
207
|
+
:passphrase => passphrase,
|
208
|
+
:withdrawal => withdrawal,
|
209
|
+
}
|
210
|
+
else
|
211
|
+
payload = { :payments => payments_formatted,
|
212
|
+
:passphrase => passphrase
|
213
|
+
}
|
214
|
+
end
|
215
|
+
|
216
|
+
self.class.post("/wallets/#{wid}/transactions",
|
217
|
+
:body => payload.to_json,
|
209
218
|
:headers => { 'Content-Type' => 'application/json' } )
|
210
219
|
end
|
211
220
|
|
@@ -214,11 +223,19 @@ module CardanoWallet
|
|
214
223
|
#
|
215
224
|
# @example
|
216
225
|
# payment_fees(wid, {addr1: 1000000})
|
217
|
-
def payment_fees(wid, payments,
|
226
|
+
def payment_fees(wid, payments, withdrawal = nil)
|
218
227
|
payments_formatted = Utils.format_payments(payments)
|
219
|
-
|
220
|
-
|
221
|
-
|
228
|
+
|
229
|
+
if withdrawal
|
230
|
+
payload = { :payments => payments_formatted,
|
231
|
+
:withdrawal => withdrawal
|
232
|
+
}
|
233
|
+
else
|
234
|
+
payload = { :payments => payments_formatted }
|
235
|
+
end
|
236
|
+
|
237
|
+
self.class.post("/wallets/#{wid}/payment-fees",
|
238
|
+
:body => payload.to_json,
|
222
239
|
:headers => { 'Content-Type' => 'application/json' } )
|
223
240
|
end
|
224
241
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cardano_wallet
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Piotr Stachyra
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-07-
|
11
|
+
date: 2020-07-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httparty
|