cardano_wallet 0.1.7 → 0.1.8

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6e71c5cdb72ca953d4289d8d343e1e769c0cd0cb24f6bc51c8487fd189c7dff2
4
- data.tar.gz: 4c4712df87921f80adf52b49db9cb8752f397b9fef31c3dd10fe895e18caa29b
3
+ metadata.gz: ebc7d4ddc02947d49ab653cfc6e1a86a09ff4e8cf7efb33921a1418a855dc68a
4
+ data.tar.gz: 187877c6fe0fa07d231676f2140a93e30bf2934e325fa9761df63e72a3c85476
5
5
  SHA512:
6
- metadata.gz: 515592573f6cdff23f85e26b32430f2913192d04d841dd23f1e1b4c2b5a11c698861f6b5c2039052ce0f6327f82c7c523cf907feb67f8a1a5b3195c1fa27b73c
7
- data.tar.gz: 3e8f0e8a30a9eda51a229c202d08adf6d91f7a67a58dbb933f1c50df83182e9b4eb448352ff9e4d5790913ecfe297f753831496807636c5ebac75cd8d065dc45
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/shelley-testnet docker-compose -f docker-compose-shelley.yml up --detach
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: master
34
+ NODE: 1.18.0
@@ -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/shelley-testnet docker-compose -f docker-compose-shelley.yml up --detach
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: master
41
+ NODE: 1.18.0
@@ -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/shelley_testnet-config.json --topology /config/shelley_testnet-topology.json --database-path /data
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/shelley_testnet-genesis.json --node-socket /ipc/node.socket --database /wallet-db --listen-address 0.0.0.0
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 q [Hash] query param (currently only withdrawRewards = true | false)
198
+ # @param withdrawal [Strin or Array] 'self' or mnemonic sentence
199
199
  #
200
200
  # @example
201
- # create(wid, passphrase, {addr1: 1000000}, q)
202
- def create(wid, passphrase, payments, q = {})
201
+ # create(wid, passphrase, {addr1: 1000000}, 'self')
202
+ def create(wid, passphrase, payments, withdrawal = nil)
203
203
  payments_formatted = Utils.format_payments(payments)
204
- q.empty? ? query = '' : query = Utils.to_query(q)
205
- self.class.post("/wallets/#{wid}/transactions#{query}",
206
- :body => { :payments => payments_formatted,
207
- :passphrase => passphrase
208
- }.to_json,
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, q = {})
226
+ def payment_fees(wid, payments, withdrawal = nil)
218
227
  payments_formatted = Utils.format_payments(payments)
219
- q.empty? ? query = '' : query = Utils.to_query(q)
220
- self.class.post("/wallets/#{wid}/payment-fees#{query}",
221
- :body => { :payments => payments_formatted }.to_json,
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
 
@@ -1,3 +1,3 @@
1
1
  module CardanoWallet
2
- VERSION = "0.1.7"
2
+ VERSION = "0.1.8"
3
3
  end
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.7
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-23 00:00:00.000000000 Z
11
+ date: 2020-07-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty