stellar-base 0.11.0 → 0.12.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +3 -9
- data/.vscode/temp.sql +0 -0
- data/CHANGELOG.md +11 -1
- data/generated/stellar-base-generated.rb +4 -1
- data/generated/stellar/allow_trust_result_code.rb +3 -1
- data/generated/stellar/change_trust_result_code.rb +8 -6
- data/generated/stellar/crypto_key_type.rb +5 -1
- data/generated/stellar/public_key.rb +4 -4
- data/generated/stellar/public_key_type.rb +20 -0
- data/generated/stellar/signer.rb +3 -3
- data/generated/stellar/signer_key.rb +31 -0
- data/generated/stellar/signer_key_type.rb +24 -0
- data/generated/stellar/time_bounds.rb +1 -1
- data/generated/stellar/transaction_envelope.rb +4 -1
- data/generated/stellar/transaction_result_set.rb +2 -2
- data/generated/stellar/transaction_set.rb +2 -2
- data/generated/stellar/transaction_signature_payload.rb +28 -0
- data/generated/stellar/transaction_signature_payload/tagged_transaction.rb +26 -0
- data/lib/stellar-base.rb +0 -1
- data/lib/stellar/base/version.rb +1 -1
- data/lib/stellar/key_pair.rb +2 -2
- data/lib/stellar/thresholds.rb +1 -1
- data/ruby-stellar-base.gemspec +3 -5
- data/spec/lib/stellar/convert_spec.rb +1 -1
- data/spec/lib/stellar/transaction_spec.rb +1 -1
- data/tasks/xdr.rake +1 -1
- data/xdr/Stellar-ledger-entries.x +1 -1
- data/xdr/Stellar-ledger.x +2 -3
- data/xdr/Stellar-transaction.x +19 -4
- data/xdr/Stellar-types.x +27 -3
- metadata +15 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 76a58244d9d43b4caf7bec1f3790b9e016591ae8
|
4
|
+
data.tar.gz: 84cea328213662741b73508b9c39e08344a72132
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f33e95865b77abb9917d09e21d8a5942aaa4863dd7b1e6a9bdab30b2de0ffe04710d29984278a7100b6f80edd630d521395ebcb84453819dc782341f5b408f49
|
7
|
+
data.tar.gz: 32d5196f9448ec39cb9745a53d2c65bd98c1d599c036f5ab742c797215de1b5d748b1c69516011a06e0f44210cb0de86a76b42645cb02de8de7fea08fbaa5d73
|
data/.travis.yml
CHANGED
@@ -1,15 +1,9 @@
|
|
1
1
|
language: ruby
|
2
2
|
rvm:
|
3
|
-
- 2.2.
|
4
|
-
- 2.
|
5
|
-
- 2.
|
6
|
-
- 1.9.3
|
7
|
-
- jruby-1.7.20
|
8
|
-
- jruby-head
|
3
|
+
- 2.2.6
|
4
|
+
- 2.3.3
|
5
|
+
- 2.4.0
|
9
6
|
script: bundle exec rake travis
|
10
7
|
notifications:
|
11
8
|
slack:
|
12
9
|
secure: V/6a8KFe067uukrbCJA2R1HPO4xy0YSQ1pwmHVRi5StX+yl+lYsWWJdjdBdT0j3iJBYyPRqU4bQYck+OloxtELnrHCX+OkodxcxW8W/ACc914iIf0FyY9pnusK7ck2awmt4Iuf94YPgi0XTm1aCcm+f0yU7wiIVFpftoXSk1EDY=
|
13
|
-
matrix:
|
14
|
-
allow_failures:
|
15
|
-
- rvm: jruby-head
|
data/.vscode/temp.sql
ADDED
File without changes
|
data/CHANGELOG.md
CHANGED
@@ -6,7 +6,17 @@ file. This project adheres to [Semantic Versioning](http://semver.org/).
|
|
6
6
|
As this project is pre 1.0, breaking changes may happen for minor version
|
7
7
|
bumps. A breaking change will get clearly notified in this log.
|
8
8
|
|
9
|
-
## [unreleased](https://github.com/stellar/ruby-stellar-base/compare/v0.
|
9
|
+
## [unreleased](https://github.com/stellar/ruby-stellar-base/compare/v0.12.0...master)
|
10
|
+
|
11
|
+
## [0.12.0](https://github.com/stellar/ruby-stellar-base/compare/v0.11.0...v0.12.0)
|
12
|
+
|
13
|
+
### Changed
|
14
|
+
- Avoid modifying $LOAD_PATH to fix load order issues
|
15
|
+
- Update XDR definitions for stellar-core 0.6 support
|
16
|
+
|
17
|
+
### Removed
|
18
|
+
|
19
|
+
- BREAKING CHANGE: Removed support for JRuby.
|
10
20
|
|
11
21
|
## [0.11.0](https://github.com/stellar/ruby-stellar-base/compare/v0.10.0...v0.11.0)
|
12
22
|
|
@@ -13,7 +13,10 @@ module Stellar
|
|
13
13
|
Uint64 = XDR::UnsignedHyper
|
14
14
|
Int64 = XDR::Hyper
|
15
15
|
autoload :CryptoKeyType
|
16
|
+
autoload :PublicKeyType
|
17
|
+
autoload :SignerKeyType
|
16
18
|
autoload :PublicKey
|
19
|
+
autoload :SignerKey
|
17
20
|
Signature = XDR::VarOpaque[64]
|
18
21
|
SignatureHint = XDR::Opaque[4]
|
19
22
|
NodeID = PublicKey
|
@@ -66,6 +69,7 @@ module Stellar
|
|
66
69
|
autoload :Memo
|
67
70
|
autoload :TimeBounds
|
68
71
|
autoload :Transaction
|
72
|
+
autoload :TransactionSignaturePayload
|
69
73
|
autoload :TransactionEnvelope
|
70
74
|
autoload :ClaimOfferAtom
|
71
75
|
autoload :CreateAccountResultCode
|
@@ -108,7 +112,6 @@ module Stellar
|
|
108
112
|
autoload :LedgerKey
|
109
113
|
autoload :BucketEntryType
|
110
114
|
autoload :BucketEntry
|
111
|
-
MAX_TX_PER_LEDGER = 5000
|
112
115
|
autoload :TransactionSet
|
113
116
|
autoload :TransactionResultPair
|
114
117
|
autoload :TransactionResultSet
|
@@ -14,7 +14,8 @@ require 'xdr'
|
|
14
14
|
# ALLOW_TRUST_NO_TRUST_LINE = -2, // trustor does not have a trustline
|
15
15
|
# // source account does not require trust
|
16
16
|
# ALLOW_TRUST_TRUST_NOT_REQUIRED = -3,
|
17
|
-
# ALLOW_TRUST_CANT_REVOKE = -4 // source account can't revoke trust
|
17
|
+
# ALLOW_TRUST_CANT_REVOKE = -4, // source account can't revoke trust,
|
18
|
+
# ALLOW_TRUST_SELF_NOT_ALLOWED = -5 // trusting self is not allowed
|
18
19
|
# };
|
19
20
|
#
|
20
21
|
# ===========================================================================
|
@@ -25,6 +26,7 @@ module Stellar
|
|
25
26
|
member :allow_trust_no_trust_line, -2
|
26
27
|
member :allow_trust_trust_not_required, -3
|
27
28
|
member :allow_trust_cant_revoke, -4
|
29
|
+
member :allow_trust_self_not_allowed, -5
|
28
30
|
|
29
31
|
seal
|
30
32
|
end
|
@@ -14,17 +14,19 @@ require 'xdr'
|
|
14
14
|
# CHANGE_TRUST_NO_ISSUER = -2, // could not find issuer
|
15
15
|
# CHANGE_TRUST_INVALID_LIMIT = -3, // cannot drop limit below balance
|
16
16
|
# // cannot create with a limit of 0
|
17
|
-
# CHANGE_TRUST_LOW_RESERVE = -4 // not enough funds to create a new trust line
|
17
|
+
# CHANGE_TRUST_LOW_RESERVE = -4, // not enough funds to create a new trust line,
|
18
|
+
# CHANGE_TRUST_SELF_NOT_ALLOWED = -5 // trusting self is not allowed
|
18
19
|
# };
|
19
20
|
#
|
20
21
|
# ===========================================================================
|
21
22
|
module Stellar
|
22
23
|
class ChangeTrustResultCode < XDR::Enum
|
23
|
-
member :change_trust_success,
|
24
|
-
member :change_trust_malformed,
|
25
|
-
member :change_trust_no_issuer,
|
26
|
-
member :change_trust_invalid_limit,
|
27
|
-
member :change_trust_low_reserve,
|
24
|
+
member :change_trust_success, 0
|
25
|
+
member :change_trust_malformed, -1
|
26
|
+
member :change_trust_no_issuer, -2
|
27
|
+
member :change_trust_invalid_limit, -3
|
28
|
+
member :change_trust_low_reserve, -4
|
29
|
+
member :change_trust_self_not_allowed, -5
|
28
30
|
|
29
31
|
seal
|
30
32
|
end
|
@@ -7,13 +7,17 @@ require 'xdr'
|
|
7
7
|
#
|
8
8
|
# enum CryptoKeyType
|
9
9
|
# {
|
10
|
-
# KEY_TYPE_ED25519 = 0
|
10
|
+
# KEY_TYPE_ED25519 = 0,
|
11
|
+
# KEY_TYPE_HASH_TX = 1,
|
12
|
+
# KEY_TYPE_HASH_X = 2
|
11
13
|
# };
|
12
14
|
#
|
13
15
|
# ===========================================================================
|
14
16
|
module Stellar
|
15
17
|
class CryptoKeyType < XDR::Enum
|
16
18
|
member :key_type_ed25519, 0
|
19
|
+
member :key_type_hash_tx, 1
|
20
|
+
member :key_type_hash_x, 2
|
17
21
|
|
18
22
|
seal
|
19
23
|
end
|
@@ -5,18 +5,18 @@ require 'xdr'
|
|
5
5
|
|
6
6
|
# === xdr source ============================================================
|
7
7
|
#
|
8
|
-
# union PublicKey switch (
|
8
|
+
# union PublicKey switch (PublicKeyType type)
|
9
9
|
# {
|
10
|
-
# case
|
10
|
+
# case PUBLIC_KEY_TYPE_ED25519:
|
11
11
|
# uint256 ed25519;
|
12
12
|
# };
|
13
13
|
#
|
14
14
|
# ===========================================================================
|
15
15
|
module Stellar
|
16
16
|
class PublicKey < XDR::Union
|
17
|
-
switch_on
|
17
|
+
switch_on PublicKeyType, :type
|
18
18
|
|
19
|
-
switch :
|
19
|
+
switch :public_key_type_ed25519, :ed25519
|
20
20
|
|
21
21
|
attribute :ed25519, Uint256
|
22
22
|
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# This code was automatically generated using xdrgen
|
2
|
+
# DO NOT EDIT or your changes may be overwritten
|
3
|
+
|
4
|
+
require 'xdr'
|
5
|
+
|
6
|
+
# === xdr source ============================================================
|
7
|
+
#
|
8
|
+
# enum PublicKeyType
|
9
|
+
# {
|
10
|
+
# PUBLIC_KEY_TYPE_ED25519 = KEY_TYPE_ED25519
|
11
|
+
# };
|
12
|
+
#
|
13
|
+
# ===========================================================================
|
14
|
+
module Stellar
|
15
|
+
class PublicKeyType < XDR::Enum
|
16
|
+
member :public_key_type_ed25519, 0
|
17
|
+
|
18
|
+
seal
|
19
|
+
end
|
20
|
+
end
|
data/generated/stellar/signer.rb
CHANGED
@@ -7,14 +7,14 @@ require 'xdr'
|
|
7
7
|
#
|
8
8
|
# struct Signer
|
9
9
|
# {
|
10
|
-
#
|
10
|
+
# SignerKey key;
|
11
11
|
# uint32 weight; // really only need 1byte
|
12
12
|
# };
|
13
13
|
#
|
14
14
|
# ===========================================================================
|
15
15
|
module Stellar
|
16
16
|
class Signer < XDR::Struct
|
17
|
-
attribute :
|
18
|
-
attribute :weight,
|
17
|
+
attribute :key, SignerKey
|
18
|
+
attribute :weight, Uint32
|
19
19
|
end
|
20
20
|
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
# This code was automatically generated using xdrgen
|
2
|
+
# DO NOT EDIT or your changes may be overwritten
|
3
|
+
|
4
|
+
require 'xdr'
|
5
|
+
|
6
|
+
# === xdr source ============================================================
|
7
|
+
#
|
8
|
+
# union SignerKey switch (SignerKeyType type)
|
9
|
+
# {
|
10
|
+
# case SIGNER_KEY_TYPE_ED25519:
|
11
|
+
# uint256 ed25519;
|
12
|
+
# case SIGNER_KEY_TYPE_HASH_TX:
|
13
|
+
# Hash hashTx;
|
14
|
+
# case SIGNER_KEY_TYPE_HASH_X:
|
15
|
+
# Hash hashX;
|
16
|
+
# };
|
17
|
+
#
|
18
|
+
# ===========================================================================
|
19
|
+
module Stellar
|
20
|
+
class SignerKey < XDR::Union
|
21
|
+
switch_on SignerKeyType, :type
|
22
|
+
|
23
|
+
switch :signer_key_type_ed25519, :ed25519
|
24
|
+
switch :signer_key_type_hash_tx, :hash_tx
|
25
|
+
switch :signer_key_type_hash_x, :hash_x
|
26
|
+
|
27
|
+
attribute :ed25519, Uint256
|
28
|
+
attribute :hash_tx, Hash
|
29
|
+
attribute :hash_x, Hash
|
30
|
+
end
|
31
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
# This code was automatically generated using xdrgen
|
2
|
+
# DO NOT EDIT or your changes may be overwritten
|
3
|
+
|
4
|
+
require 'xdr'
|
5
|
+
|
6
|
+
# === xdr source ============================================================
|
7
|
+
#
|
8
|
+
# enum SignerKeyType
|
9
|
+
# {
|
10
|
+
# SIGNER_KEY_TYPE_ED25519 = KEY_TYPE_ED25519,
|
11
|
+
# SIGNER_KEY_TYPE_HASH_TX = KEY_TYPE_HASH_TX,
|
12
|
+
# SIGNER_KEY_TYPE_HASH_X = KEY_TYPE_HASH_X
|
13
|
+
# };
|
14
|
+
#
|
15
|
+
# ===========================================================================
|
16
|
+
module Stellar
|
17
|
+
class SignerKeyType < XDR::Enum
|
18
|
+
member :signer_key_type_ed25519, 0
|
19
|
+
member :signer_key_type_hash_tx, 1
|
20
|
+
member :signer_key_type_hash_x, 2
|
21
|
+
|
22
|
+
seal
|
23
|
+
end
|
24
|
+
end
|
@@ -8,7 +8,10 @@ require 'xdr'
|
|
8
8
|
# struct TransactionEnvelope
|
9
9
|
# {
|
10
10
|
# Transaction tx;
|
11
|
-
#
|
11
|
+
# /* Each decorated signature is a signature over the SHA256 hash of
|
12
|
+
# * a TransactionSignaturePayload */
|
13
|
+
# DecoratedSignature
|
14
|
+
# signatures<20>;
|
12
15
|
# };
|
13
16
|
#
|
14
17
|
# ===========================================================================
|
@@ -7,12 +7,12 @@ require 'xdr'
|
|
7
7
|
#
|
8
8
|
# struct TransactionResultSet
|
9
9
|
# {
|
10
|
-
# TransactionResultPair results
|
10
|
+
# TransactionResultPair results<>;
|
11
11
|
# };
|
12
12
|
#
|
13
13
|
# ===========================================================================
|
14
14
|
module Stellar
|
15
15
|
class TransactionResultSet < XDR::Struct
|
16
|
-
attribute :results, XDR::VarArray[TransactionResultPair
|
16
|
+
attribute :results, XDR::VarArray[TransactionResultPair]
|
17
17
|
end
|
18
18
|
end
|
@@ -8,13 +8,13 @@ require 'xdr'
|
|
8
8
|
# struct TransactionSet
|
9
9
|
# {
|
10
10
|
# Hash previousLedgerHash;
|
11
|
-
# TransactionEnvelope txs
|
11
|
+
# TransactionEnvelope txs<>;
|
12
12
|
# };
|
13
13
|
#
|
14
14
|
# ===========================================================================
|
15
15
|
module Stellar
|
16
16
|
class TransactionSet < XDR::Struct
|
17
17
|
attribute :previous_ledger_hash, Hash
|
18
|
-
attribute :txs, XDR::VarArray[TransactionEnvelope
|
18
|
+
attribute :txs, XDR::VarArray[TransactionEnvelope]
|
19
19
|
end
|
20
20
|
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
# This code was automatically generated using xdrgen
|
2
|
+
# DO NOT EDIT or your changes may be overwritten
|
3
|
+
|
4
|
+
require 'xdr'
|
5
|
+
|
6
|
+
# === xdr source ============================================================
|
7
|
+
#
|
8
|
+
# struct TransactionSignaturePayload {
|
9
|
+
# Hash networkId;
|
10
|
+
# union switch (EnvelopeType type)
|
11
|
+
# {
|
12
|
+
# case ENVELOPE_TYPE_TX:
|
13
|
+
# Transaction tx;
|
14
|
+
# /* All other values of type are invalid */
|
15
|
+
# } taggedTransaction;
|
16
|
+
# };
|
17
|
+
#
|
18
|
+
# ===========================================================================
|
19
|
+
module Stellar
|
20
|
+
class TransactionSignaturePayload < XDR::Struct
|
21
|
+
include XDR::Namespace
|
22
|
+
|
23
|
+
autoload :TaggedTransaction
|
24
|
+
|
25
|
+
attribute :network_id, Hash
|
26
|
+
attribute :tagged_transaction, TaggedTransaction
|
27
|
+
end
|
28
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
# This code was automatically generated using xdrgen
|
2
|
+
# DO NOT EDIT or your changes may be overwritten
|
3
|
+
|
4
|
+
require 'xdr'
|
5
|
+
|
6
|
+
# === xdr source ============================================================
|
7
|
+
#
|
8
|
+
# union switch (EnvelopeType type)
|
9
|
+
# {
|
10
|
+
# case ENVELOPE_TYPE_TX:
|
11
|
+
# Transaction tx;
|
12
|
+
# /* All other values of type are invalid */
|
13
|
+
# }
|
14
|
+
#
|
15
|
+
# ===========================================================================
|
16
|
+
module Stellar
|
17
|
+
class TransactionSignaturePayload
|
18
|
+
class TaggedTransaction < XDR::Union
|
19
|
+
switch_on EnvelopeType, :type
|
20
|
+
|
21
|
+
switch :envelope_type_tx, :tx
|
22
|
+
|
23
|
+
attribute :tx, Transaction
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
data/lib/stellar-base.rb
CHANGED
data/lib/stellar/base/version.rb
CHANGED
data/lib/stellar/key_pair.rb
CHANGED
@@ -42,11 +42,11 @@ module Stellar
|
|
42
42
|
end
|
43
43
|
|
44
44
|
def account_id
|
45
|
-
Stellar::AccountID.new :
|
45
|
+
Stellar::AccountID.new :public_key_type_ed25519, raw_public_key
|
46
46
|
end
|
47
47
|
|
48
48
|
def public_key
|
49
|
-
Stellar::PublicKey.new :
|
49
|
+
Stellar::PublicKey.new :public_key_type_ed25519, raw_public_key
|
50
50
|
end
|
51
51
|
|
52
52
|
def raw_public_key
|
data/lib/stellar/thresholds.rb
CHANGED
data/ruby-stellar-base.gemspec
CHANGED
@@ -1,7 +1,5 @@
|
|
1
1
|
# coding: utf-8
|
2
|
-
|
3
|
-
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
-
require 'stellar/base/version'
|
2
|
+
require_relative './lib/stellar/base/version'
|
5
3
|
|
6
4
|
Gem::Specification.new do |spec|
|
7
5
|
spec.name = "stellar-base"
|
@@ -17,12 +15,12 @@ Gem::Specification.new do |spec|
|
|
17
15
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
18
16
|
spec.require_paths = ["generated", "lib"]
|
19
17
|
|
20
|
-
spec.add_dependency "xdr", "~>
|
18
|
+
spec.add_dependency "xdr", "~> 2.0.0"
|
21
19
|
spec.add_dependency "digest-crc"
|
22
20
|
spec.add_dependency "base32"
|
23
21
|
spec.add_dependency "rbnacl"
|
24
22
|
spec.add_dependency "rbnacl-libsodium", "~> 1.0.3"
|
25
|
-
spec.add_dependency "activesupport", "
|
23
|
+
spec.add_dependency "activesupport", ">= 4.2.7"
|
26
24
|
|
27
25
|
spec.add_development_dependency "bundler", "~> 1.7"
|
28
26
|
spec.add_development_dependency "rake", "~> 10.0"
|
@@ -51,7 +51,7 @@ describe Stellar::Convert do
|
|
51
51
|
|
52
52
|
describe "#pk_to_address" do
|
53
53
|
let(:pk_raw){ "\x00" * 32 }
|
54
|
-
let(:pk_account_id){ Stellar::AccountID.new(:
|
54
|
+
let(:pk_account_id){ Stellar::AccountID.new(:public_key_type_ed25519, pk_raw)}
|
55
55
|
|
56
56
|
it "converts a Stellar::AccountID into an address using StrKey.check_encode(:account_id)" do
|
57
57
|
address = Stellar::Util::StrKey.check_encode(:account_id, pk_raw)
|
@@ -3,7 +3,7 @@ require "spec_helper"
|
|
3
3
|
describe Stellar::Transaction do
|
4
4
|
subject do
|
5
5
|
Stellar::Transaction.new({
|
6
|
-
source_account: Stellar::AccountID.new(:
|
6
|
+
source_account: Stellar::AccountID.new(:public_key_type_ed25519, "\x00" * 32),
|
7
7
|
fee: 10,
|
8
8
|
seq_num: 1,
|
9
9
|
memo: Stellar::Memo.new(:memo_none),
|
data/tasks/xdr.rake
CHANGED
@@ -26,7 +26,7 @@ namespace :xdr do
|
|
26
26
|
|
27
27
|
HAYASHI_XDR.each do |src|
|
28
28
|
local_path = "xdr/" + File.basename(src)
|
29
|
-
encoded = client.contents("stellar/stellar-core", path: src).content
|
29
|
+
encoded = client.contents("stellar/stellar-core", path: src, ref:"1c2a3fb7a29eedb0c9513132834dd38fee243a63").content
|
30
30
|
decoded = Base64.decode64 encoded
|
31
31
|
|
32
32
|
IO.write(local_path, decoded)
|
data/xdr/Stellar-ledger.x
CHANGED
@@ -144,11 +144,10 @@ case DEADENTRY:
|
|
144
144
|
|
145
145
|
// Transaction sets are the unit used by SCP to decide on transitions
|
146
146
|
// between ledgers
|
147
|
-
const MAX_TX_PER_LEDGER = 5000;
|
148
147
|
struct TransactionSet
|
149
148
|
{
|
150
149
|
Hash previousLedgerHash;
|
151
|
-
TransactionEnvelope txs
|
150
|
+
TransactionEnvelope txs<>;
|
152
151
|
};
|
153
152
|
|
154
153
|
struct TransactionResultPair
|
@@ -160,7 +159,7 @@ struct TransactionResultPair
|
|
160
159
|
// TransactionResultSet is used to recover results between ledgers
|
161
160
|
struct TransactionResultSet
|
162
161
|
{
|
163
|
-
TransactionResultPair results
|
162
|
+
TransactionResultPair results<>;
|
164
163
|
};
|
165
164
|
|
166
165
|
// Entries below are used in the historical subsystem
|
data/xdr/Stellar-transaction.x
CHANGED
@@ -283,7 +283,7 @@ case MEMO_RETURN:
|
|
283
283
|
struct TimeBounds
|
284
284
|
{
|
285
285
|
uint64 minTime;
|
286
|
-
uint64 maxTime;
|
286
|
+
uint64 maxTime; // 0 here means no maxTime
|
287
287
|
};
|
288
288
|
|
289
289
|
/* a transaction is a container for a set of operations
|
@@ -321,11 +321,24 @@ struct Transaction
|
|
321
321
|
ext;
|
322
322
|
};
|
323
323
|
|
324
|
+
struct TransactionSignaturePayload {
|
325
|
+
Hash networkId;
|
326
|
+
union switch (EnvelopeType type)
|
327
|
+
{
|
328
|
+
case ENVELOPE_TYPE_TX:
|
329
|
+
Transaction tx;
|
330
|
+
/* All other values of type are invalid */
|
331
|
+
} taggedTransaction;
|
332
|
+
};
|
333
|
+
|
324
334
|
/* A TransactionEnvelope wraps a transaction with signatures. */
|
325
335
|
struct TransactionEnvelope
|
326
336
|
{
|
327
337
|
Transaction tx;
|
328
|
-
|
338
|
+
/* Each decorated signature is a signature over the SHA256 hash of
|
339
|
+
* a TransactionSignaturePayload */
|
340
|
+
DecoratedSignature
|
341
|
+
signatures<20>;
|
329
342
|
};
|
330
343
|
|
331
344
|
/* Operation Results section */
|
@@ -532,7 +545,8 @@ enum ChangeTrustResultCode
|
|
532
545
|
CHANGE_TRUST_NO_ISSUER = -2, // could not find issuer
|
533
546
|
CHANGE_TRUST_INVALID_LIMIT = -3, // cannot drop limit below balance
|
534
547
|
// cannot create with a limit of 0
|
535
|
-
CHANGE_TRUST_LOW_RESERVE = -4 // not enough funds to create a new trust line
|
548
|
+
CHANGE_TRUST_LOW_RESERVE = -4, // not enough funds to create a new trust line,
|
549
|
+
CHANGE_TRUST_SELF_NOT_ALLOWED = -5 // trusting self is not allowed
|
536
550
|
};
|
537
551
|
|
538
552
|
union ChangeTrustResult switch (ChangeTrustResultCode code)
|
@@ -554,7 +568,8 @@ enum AllowTrustResultCode
|
|
554
568
|
ALLOW_TRUST_NO_TRUST_LINE = -2, // trustor does not have a trustline
|
555
569
|
// source account does not require trust
|
556
570
|
ALLOW_TRUST_TRUST_NOT_REQUIRED = -3,
|
557
|
-
ALLOW_TRUST_CANT_REVOKE = -4 // source account can't revoke trust
|
571
|
+
ALLOW_TRUST_CANT_REVOKE = -4, // source account can't revoke trust,
|
572
|
+
ALLOW_TRUST_SELF_NOT_ALLOWED = -5 // trusting self is not allowed
|
558
573
|
};
|
559
574
|
|
560
575
|
union AllowTrustResult switch (AllowTrustResultCode code)
|
data/xdr/Stellar-types.x
CHANGED
@@ -16,13 +16,37 @@ typedef hyper int64;
|
|
16
16
|
|
17
17
|
enum CryptoKeyType
|
18
18
|
{
|
19
|
-
KEY_TYPE_ED25519 = 0
|
19
|
+
KEY_TYPE_ED25519 = 0,
|
20
|
+
KEY_TYPE_HASH_TX = 1,
|
21
|
+
KEY_TYPE_HASH_X = 2
|
20
22
|
};
|
21
23
|
|
22
|
-
|
24
|
+
enum PublicKeyType
|
23
25
|
{
|
24
|
-
|
26
|
+
PUBLIC_KEY_TYPE_ED25519 = KEY_TYPE_ED25519
|
27
|
+
};
|
28
|
+
|
29
|
+
enum SignerKeyType
|
30
|
+
{
|
31
|
+
SIGNER_KEY_TYPE_ED25519 = KEY_TYPE_ED25519,
|
32
|
+
SIGNER_KEY_TYPE_HASH_TX = KEY_TYPE_HASH_TX,
|
33
|
+
SIGNER_KEY_TYPE_HASH_X = KEY_TYPE_HASH_X
|
34
|
+
};
|
35
|
+
|
36
|
+
union PublicKey switch (PublicKeyType type)
|
37
|
+
{
|
38
|
+
case PUBLIC_KEY_TYPE_ED25519:
|
39
|
+
uint256 ed25519;
|
40
|
+
};
|
41
|
+
|
42
|
+
union SignerKey switch (SignerKeyType type)
|
43
|
+
{
|
44
|
+
case SIGNER_KEY_TYPE_ED25519:
|
25
45
|
uint256 ed25519;
|
46
|
+
case SIGNER_KEY_TYPE_HASH_TX:
|
47
|
+
Hash hashTx;
|
48
|
+
case SIGNER_KEY_TYPE_HASH_X:
|
49
|
+
Hash hashX;
|
26
50
|
};
|
27
51
|
|
28
52
|
// variable size as the size depends on the signature scheme used
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: stellar-base
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.12.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Scott Fleckenstein
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-02-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: xdr
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 2.0.0
|
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:
|
26
|
+
version: 2.0.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: digest-crc
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -84,16 +84,16 @@ dependencies:
|
|
84
84
|
name: activesupport
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
|
-
- - "
|
87
|
+
- - ">="
|
88
88
|
- !ruby/object:Gem::Version
|
89
|
-
version:
|
89
|
+
version: 4.2.7
|
90
90
|
type: :runtime
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
|
-
- - "
|
94
|
+
- - ">="
|
95
95
|
- !ruby/object:Gem::Version
|
96
|
-
version:
|
96
|
+
version: 4.2.7
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
98
|
name: bundler
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
@@ -229,6 +229,7 @@ extra_rdoc_files: []
|
|
229
229
|
files:
|
230
230
|
- ".gitignore"
|
231
231
|
- ".travis.yml"
|
232
|
+
- ".vscode/temp.sql"
|
232
233
|
- ".yardopts"
|
233
234
|
- CHANGELOG.md
|
234
235
|
- CONTRIBUTING.md
|
@@ -339,6 +340,7 @@ files:
|
|
339
340
|
- generated/stellar/peer_address/ip.rb
|
340
341
|
- generated/stellar/price.rb
|
341
342
|
- generated/stellar/public_key.rb
|
343
|
+
- generated/stellar/public_key_type.rb
|
342
344
|
- generated/stellar/scp_ballot.rb
|
343
345
|
- generated/stellar/scp_envelope.rb
|
344
346
|
- generated/stellar/scp_history_entry.rb
|
@@ -355,6 +357,8 @@ files:
|
|
355
357
|
- generated/stellar/set_options_result.rb
|
356
358
|
- generated/stellar/set_options_result_code.rb
|
357
359
|
- generated/stellar/signer.rb
|
360
|
+
- generated/stellar/signer_key.rb
|
361
|
+
- generated/stellar/signer_key_type.rb
|
358
362
|
- generated/stellar/simple_payment_result.rb
|
359
363
|
- generated/stellar/stellar_message.rb
|
360
364
|
- generated/stellar/stellar_value.rb
|
@@ -376,6 +380,8 @@ files:
|
|
376
380
|
- generated/stellar/transaction_result_pair.rb
|
377
381
|
- generated/stellar/transaction_result_set.rb
|
378
382
|
- generated/stellar/transaction_set.rb
|
383
|
+
- generated/stellar/transaction_signature_payload.rb
|
384
|
+
- generated/stellar/transaction_signature_payload/tagged_transaction.rb
|
379
385
|
- generated/stellar/trust_line_entry.rb
|
380
386
|
- generated/stellar/trust_line_entry/ext.rb
|
381
387
|
- generated/stellar/trust_line_flags.rb
|
@@ -442,7 +448,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
442
448
|
version: '0'
|
443
449
|
requirements: []
|
444
450
|
rubyforge_project:
|
445
|
-
rubygems_version: 2.
|
451
|
+
rubygems_version: 2.6.8
|
446
452
|
signing_key:
|
447
453
|
specification_version: 4
|
448
454
|
summary: 'Stellar client library: XDR'
|
@@ -463,4 +469,3 @@ test_files:
|
|
463
469
|
- spec/support/matchers/be_strkey.rb
|
464
470
|
- spec/support/matchers/eq_bytes.rb
|
465
471
|
- spec/support/matchers/have_length.rb
|
466
|
-
has_rdoc:
|