stellar_core_commander 0.0.5 → 0.0.6

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
  SHA1:
3
- metadata.gz: 4dec4ab758b6608c7e26230a74b25aa8ffded225
4
- data.tar.gz: 1521e0cd109182ef2dce0e1a23d64e1f561564ec
3
+ metadata.gz: 7404e814b58b7ea5012e5cca8cf96b30223d9723
4
+ data.tar.gz: d0d48ebcbd0658d51a7565fc986a0182d28277ab
5
5
  SHA512:
6
- metadata.gz: 533e79bc7a73ad68a74053d8b9c4cdc7939c551b320eb1c1843c3e2fecaf1d77acda29eded95291eaa6e49952f3a78daaf6f050a50e6eea164e9e201e950aca3
7
- data.tar.gz: 028e88ea25661007c3e7c6a63fe46246d685a23cc1b9d1ea5890812badebfa267603a248d25cd30fe3cee1872e12db8b2f56776293afcd12b25764789b690986
6
+ metadata.gz: c54e845ba8da423c8205d6014d61cde2139a10f0f8d5f51b959aef968ce4fdf029fb47ab022bb5ec68e1846ee5295c9cff9202e6dc6bcee41a1cca83951e61ec
7
+ data.tar.gz: 693ca68613c2b5e3252828ca7286ee24741437f3639e5819313b6445ba263edd12be576d458f78b8ff4bb25e3053aedc488ed1428ca4c832c58181f4be29468b
@@ -2,9 +2,9 @@ account :usd_gateway
2
2
  account :scott
3
3
  account :andrew
4
4
 
5
- payment :master, :usd_gateway, [:native, 1000_000000]
6
- payment :master, :scott, [:native, 1000_000000]
7
- payment :master, :andrew, [:native, 1000_000000]
5
+ create_account :usd_gateway
6
+ create_account :scott
7
+ create_account :andrew
8
8
 
9
9
  close_ledger
10
10
 
@@ -1,3 +1,5 @@
1
+ # DOES NOT YET WORK WITH LATEST TRANSACTION TYPES
2
+
1
3
  account :usd_gateway
2
4
  account :eur_gateway
3
5
  account :scott
@@ -1,3 +1,7 @@
1
1
  account :scott
2
2
 
3
+ create_account :scott, :master
4
+
5
+ close_ledger
6
+
3
7
  payment :master, :scott, [:native, 1000_000000]
@@ -34,13 +34,27 @@ module StellarCoreCommander
34
34
  amount: amount,
35
35
  }
36
36
 
37
- if options[:path]
38
- attrs[:path] = options[:path].map{|p| make_currency p}
39
- end
37
+ # TODO: Fix pathed payments
38
+ # if options[:path]
39
+ # attrs[:path] = options[:path].map{|p| make_currency p}
40
+ # end
40
41
 
41
42
  Stellar::Transaction.payment(attrs).to_envelope(from)
42
43
  end
43
44
 
45
+ Contract Symbol, Symbol, Num => Any
46
+ def create_account(account, funder=:master, starting_balance=1000_0000000)
47
+ account = get_account account
48
+ funder = get_account funder
49
+
50
+ Stellar::Transaction.create_account({
51
+ account: funder,
52
+ destination: account,
53
+ sequence: next_sequence(funder),
54
+ starting_balance: starting_balance,
55
+ }).to_envelope(funder)
56
+ end
57
+
44
58
  Contract Symbol, Symbol, String => Any
45
59
  def trust(account, issuer, code)
46
60
  change_trust account, issuer, code, (2**63)-1
@@ -62,6 +62,13 @@ module StellarCoreCommander
62
62
  end
63
63
  end
64
64
 
65
+ #
66
+ # @see StellarCoreCommander::OperationBuilder#create_account
67
+ def create_account(*args)
68
+ envelope = @operation_builder.create_account(*args)
69
+ submit_transaction envelope
70
+ end
71
+
65
72
  #
66
73
  # @see StellarCoreCommander::OperationBuilder#trust
67
74
  def trust(*args)
@@ -141,7 +148,7 @@ module StellarCoreCommander
141
148
  def next_sequence(account)
142
149
  base_sequence = @process.sequence_for(account)
143
150
  inflight_count = @unverified.select{|e| e.first.tx.source_account == account.public_key}.length
144
-
151
+
145
152
  base_sequence + inflight_count + 1
146
153
  end
147
154
 
@@ -1,3 +1,3 @@
1
1
  module StellarCoreCommander
2
- VERSION = "0.0.5"
2
+ VERSION = "0.0.6"
3
3
  end
@@ -17,7 +17,7 @@ Gem::Specification.new do |spec|
17
17
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
18
18
  spec.require_paths = ["lib"]
19
19
 
20
- spec.add_dependency "stellar-base", "= 0.0.7"
20
+ spec.add_dependency "stellar-base", "= 0.0.8"
21
21
  spec.add_dependency "slop", "~> 3.6.0"
22
22
  spec.add_dependency "faraday", "~> 0.9.1"
23
23
  spec.add_dependency "faraday_middleware", "~> 0.9.1"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stellar_core_commander
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Scott Fleckenstein
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-05-12 00:00:00.000000000 Z
11
+ date: 2015-05-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: stellar-base
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 0.0.7
19
+ version: 0.0.8
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - '='
25
25
  - !ruby/object:Gem::Version
26
- version: 0.0.7
26
+ version: 0.0.8
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: slop
29
29
  requirement: !ruby/object:Gem::Requirement