stellar-base 0.4.0 → 0.5.0
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/CHANGELOG.md +9 -1
- data/generated/stellar-base-generated.rb +1 -0
- data/generated/stellar/asset.rb +2 -2
- data/generated/stellar/asset/alpha_num12.rb +1 -1
- data/generated/stellar/asset/alpha_num4.rb +1 -1
- data/generated/stellar/{transaction_meta/v0.rb → auth.rb} +6 -10
- data/generated/stellar/hello.rb +4 -0
- data/generated/stellar/manage_offer_result_code.rb +2 -4
- data/generated/stellar/message_type.rb +20 -18
- data/generated/stellar/operation_result_code.rb +1 -1
- data/generated/stellar/set_options_result_code.rb +3 -1
- data/generated/stellar/stellar_message.rb +4 -0
- data/generated/stellar/transaction_meta.rb +3 -11
- data/generated/stellar/transaction_result_code.rb +2 -2
- data/lib/stellar/base/version.rb +1 -1
- data/xdr/Stellar-ledger-entries.x +2 -2
- data/xdr/Stellar-ledger.x +1 -5
- data/xdr/Stellar-overlay.x +19 -9
- data/xdr/Stellar-transaction.x +6 -6
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f62dbbc8c4cfab0e7442158b874a6727b9a1587b
|
4
|
+
data.tar.gz: 74c2fdc17920e243a5ff834fad189ee379d3d71c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 196a2a877e503b619e1e0983b31f4cb7e3c3ad96670fa22e57715ce517a58d42694173e2cfcce465a7492dbac267d00ede455a2390bd1b7c938ffcc441a1c0e1
|
7
|
+
data.tar.gz: 12fac317f0a5528ba79c45317193e7aa8d4635acc1969569b47ca38bfbf8f12163ca4fed77ad376c14c31c670c43fd3e8f916786ddd526fe3939700039f15bfc
|
data/CHANGELOG.md
CHANGED
@@ -1,9 +1,17 @@
|
|
1
|
-
# Changelog
|
1
|
+
# Changelog
|
2
|
+
|
3
|
+
All notable changes to this project will be documented in this
|
2
4
|
file. This project adheres to [Semantic Versioning](http://semver.org/).
|
3
5
|
|
4
6
|
As this project is pre 1.0, breaking changes may happen for minor version
|
5
7
|
bumps. A breaking change will get clearly notified in this log.
|
6
8
|
|
9
|
+
## [0.5.0](https://github.com/stellar/ruby-stellar-base/compare/v0.4.0...v0.5.0)
|
10
|
+
|
11
|
+
### Changed
|
12
|
+
|
13
|
+
- Update to latest xdr
|
14
|
+
|
7
15
|
## [0.4.0](https://github.com/stellar/ruby-stellar-base/compare/v0.3.0...v0.4.0)
|
8
16
|
|
9
17
|
### Changed
|
data/generated/stellar/asset.rb
CHANGED
@@ -13,14 +13,14 @@ require 'xdr'
|
|
13
13
|
# case ASSET_TYPE_CREDIT_ALPHANUM4:
|
14
14
|
# struct
|
15
15
|
# {
|
16
|
-
# opaque assetCode[4];
|
16
|
+
# opaque assetCode[4]; // 1 to 4 characters
|
17
17
|
# AccountID issuer;
|
18
18
|
# } alphaNum4;
|
19
19
|
#
|
20
20
|
# case ASSET_TYPE_CREDIT_ALPHANUM12:
|
21
21
|
# struct
|
22
22
|
# {
|
23
|
-
# opaque assetCode[12];
|
23
|
+
# opaque assetCode[12]; // 5 to 12 characters
|
24
24
|
# AccountID issuer;
|
25
25
|
# } alphaNum12;
|
26
26
|
#
|
@@ -5,18 +5,14 @@ require 'xdr'
|
|
5
5
|
|
6
6
|
# === xdr source ============================================================
|
7
7
|
#
|
8
|
-
# struct
|
9
|
-
#
|
10
|
-
#
|
11
|
-
#
|
12
|
-
# }
|
8
|
+
# struct Auth
|
9
|
+
# {
|
10
|
+
# Signature signature;
|
11
|
+
# };
|
13
12
|
#
|
14
13
|
# ===========================================================================
|
15
14
|
module Stellar
|
16
|
-
class
|
17
|
-
|
18
|
-
attribute :changes, LedgerEntryChanges
|
19
|
-
attribute :operations, XDR::VarArray[OperationMeta]
|
20
|
-
end
|
15
|
+
class Auth < XDR::Struct
|
16
|
+
attribute :signature, Signature
|
21
17
|
end
|
22
18
|
end
|
data/generated/stellar/hello.rb
CHANGED
@@ -9,9 +9,11 @@ require 'xdr'
|
|
9
9
|
# {
|
10
10
|
# uint32 ledgerVersion;
|
11
11
|
# uint32 overlayVersion;
|
12
|
+
# Hash networkID;
|
12
13
|
# string versionStr<100>;
|
13
14
|
# int listeningPort;
|
14
15
|
# NodeID peerID;
|
16
|
+
# uint256 nonce;
|
15
17
|
# };
|
16
18
|
#
|
17
19
|
# ===========================================================================
|
@@ -19,8 +21,10 @@ module Stellar
|
|
19
21
|
class Hello < XDR::Struct
|
20
22
|
attribute :ledger_version, Uint32
|
21
23
|
attribute :overlay_version, Uint32
|
24
|
+
attribute :network_id, Hash
|
22
25
|
attribute :version_str, XDR::String[100]
|
23
26
|
attribute :listening_port, XDR::Int
|
24
27
|
attribute :peer_id, NodeID
|
28
|
+
attribute :nonce, Uint256
|
25
29
|
end
|
26
30
|
end
|
@@ -22,9 +22,8 @@ require 'xdr'
|
|
22
22
|
#
|
23
23
|
# // update errors
|
24
24
|
# MANAGE_OFFER_NOT_FOUND = -9, // offerID does not match an existing offer
|
25
|
-
# MANAGE_OFFER_MISMATCH = -10, // currencies don't match offer
|
26
25
|
#
|
27
|
-
# MANAGE_OFFER_LOW_RESERVE = -
|
26
|
+
# MANAGE_OFFER_LOW_RESERVE = -10 // not enough funds to create a new Offer
|
28
27
|
# };
|
29
28
|
#
|
30
29
|
# ===========================================================================
|
@@ -40,8 +39,7 @@ module Stellar
|
|
40
39
|
member :manage_offer_underfunded, -7
|
41
40
|
member :manage_offer_cross_self, -8
|
42
41
|
member :manage_offer_not_found, -9
|
43
|
-
member :
|
44
|
-
member :manage_offer_low_reserve, -11
|
42
|
+
member :manage_offer_low_reserve, -10
|
45
43
|
|
46
44
|
seal
|
47
45
|
end
|
@@ -9,20 +9,21 @@ require 'xdr'
|
|
9
9
|
# {
|
10
10
|
# ERROR_MSG = 0,
|
11
11
|
# HELLO = 1,
|
12
|
-
#
|
12
|
+
# AUTH = 2,
|
13
|
+
# DONT_HAVE = 3,
|
13
14
|
#
|
14
|
-
# GET_PEERS =
|
15
|
-
# PEERS =
|
15
|
+
# GET_PEERS = 4, // gets a list of peers this guy knows about
|
16
|
+
# PEERS = 5,
|
16
17
|
#
|
17
|
-
# GET_TX_SET =
|
18
|
-
# TX_SET =
|
18
|
+
# GET_TX_SET = 6, // gets a particular txset by hash
|
19
|
+
# TX_SET = 7,
|
19
20
|
#
|
20
|
-
# TRANSACTION =
|
21
|
+
# TRANSACTION = 8, // pass on a tx you have heard about
|
21
22
|
#
|
22
23
|
# // SCP
|
23
|
-
# GET_SCP_QUORUMSET =
|
24
|
-
# SCP_QUORUMSET =
|
25
|
-
# SCP_MESSAGE =
|
24
|
+
# GET_SCP_QUORUMSET = 9,
|
25
|
+
# SCP_QUORUMSET = 10,
|
26
|
+
# SCP_MESSAGE = 11
|
26
27
|
# };
|
27
28
|
#
|
28
29
|
# ===========================================================================
|
@@ -30,15 +31,16 @@ module Stellar
|
|
30
31
|
class MessageType < XDR::Enum
|
31
32
|
member :error_msg, 0
|
32
33
|
member :hello, 1
|
33
|
-
member :
|
34
|
-
member :
|
35
|
-
member :
|
36
|
-
member :
|
37
|
-
member :
|
38
|
-
member :
|
39
|
-
member :
|
40
|
-
member :
|
41
|
-
member :
|
34
|
+
member :auth, 2
|
35
|
+
member :dont_have, 3
|
36
|
+
member :get_peers, 4
|
37
|
+
member :peers, 5
|
38
|
+
member :get_tx_set, 6
|
39
|
+
member :tx_set, 7
|
40
|
+
member :transaction, 8
|
41
|
+
member :get_scp_quorumset, 9
|
42
|
+
member :scp_quorumset, 10
|
43
|
+
member :scp_message, 11
|
42
44
|
|
43
45
|
seal
|
44
46
|
end
|
@@ -9,7 +9,7 @@ require 'xdr'
|
|
9
9
|
# {
|
10
10
|
# opINNER = 0, // inner object result is valid
|
11
11
|
#
|
12
|
-
# opBAD_AUTH = -1, //
|
12
|
+
# opBAD_AUTH = -1, // too few valid signatures / wrong network
|
13
13
|
# opNO_ACCOUNT = -2 // source account was not found
|
14
14
|
# };
|
15
15
|
#
|
@@ -17,7 +17,8 @@ require 'xdr'
|
|
17
17
|
# SET_OPTIONS_CANT_CHANGE = -5, // can no longer change this option
|
18
18
|
# SET_OPTIONS_UNKNOWN_FLAG = -6, // can't set an unknown flag
|
19
19
|
# SET_OPTIONS_THRESHOLD_OUT_OF_RANGE = -7, // bad value for weight/threshold
|
20
|
-
# SET_OPTIONS_BAD_SIGNER = -8
|
20
|
+
# SET_OPTIONS_BAD_SIGNER = -8, // signer cannot be masterkey
|
21
|
+
# SET_OPTIONS_INVALID_HOME_DOMAIN = -9 // malformed home domain
|
21
22
|
# };
|
22
23
|
#
|
23
24
|
# ===========================================================================
|
@@ -32,6 +33,7 @@ module Stellar
|
|
32
33
|
member :set_options_unknown_flag, -6
|
33
34
|
member :set_options_threshold_out_of_range, -7
|
34
35
|
member :set_options_bad_signer, -8
|
36
|
+
member :set_options_invalid_home_domain, -9
|
35
37
|
|
36
38
|
seal
|
37
39
|
end
|
@@ -11,6 +11,8 @@ require 'xdr'
|
|
11
11
|
# Error error;
|
12
12
|
# case HELLO:
|
13
13
|
# Hello hello;
|
14
|
+
# case AUTH:
|
15
|
+
# Auth auth;
|
14
16
|
# case DONT_HAVE:
|
15
17
|
# DontHave dontHave;
|
16
18
|
# case GET_PEERS:
|
@@ -42,6 +44,7 @@ module Stellar
|
|
42
44
|
|
43
45
|
switch :error_msg, :error
|
44
46
|
switch :hello, :hello
|
47
|
+
switch :auth, :auth
|
45
48
|
switch :dont_have, :dont_have
|
46
49
|
switch :get_peers
|
47
50
|
switch :peers, :peers
|
@@ -54,6 +57,7 @@ module Stellar
|
|
54
57
|
|
55
58
|
attribute :error, Error
|
56
59
|
attribute :hello, Hello
|
60
|
+
attribute :auth, Auth
|
57
61
|
attribute :dont_have, DontHave
|
58
62
|
attribute :peers, XDR::VarArray[PeerAddress]
|
59
63
|
attribute :tx_set_hash, Uint256
|
@@ -8,24 +8,16 @@ require 'xdr'
|
|
8
8
|
# union TransactionMeta switch (int v)
|
9
9
|
# {
|
10
10
|
# case 0:
|
11
|
-
#
|
12
|
-
# {
|
13
|
-
# LedgerEntryChanges changes;
|
14
|
-
# OperationMeta operations<>;
|
15
|
-
# } v0;
|
11
|
+
# OperationMeta operations<>;
|
16
12
|
# };
|
17
13
|
#
|
18
14
|
# ===========================================================================
|
19
15
|
module Stellar
|
20
16
|
class TransactionMeta < XDR::Union
|
21
|
-
include XDR::Namespace
|
22
|
-
|
23
|
-
autoload :V0
|
24
|
-
|
25
17
|
switch_on XDR::Int, :v
|
26
18
|
|
27
|
-
switch 0, :
|
19
|
+
switch 0, :operations
|
28
20
|
|
29
|
-
attribute :
|
21
|
+
attribute :operations, XDR::VarArray[OperationMeta]
|
30
22
|
end
|
31
23
|
end
|
@@ -16,11 +16,11 @@ require 'xdr'
|
|
16
16
|
# txMISSING_OPERATION = -4, // no operation was specified
|
17
17
|
# txBAD_SEQ = -5, // sequence number does not match source account
|
18
18
|
#
|
19
|
-
# txBAD_AUTH = -6, //
|
19
|
+
# txBAD_AUTH = -6, // too few valid signatures / wrong network
|
20
20
|
# txINSUFFICIENT_BALANCE = -7, // fee would bring account below reserve
|
21
21
|
# txNO_ACCOUNT = -8, // source account not found
|
22
22
|
# txINSUFFICIENT_FEE = -9, // fee is too small
|
23
|
-
# txBAD_AUTH_EXTRA = -10, //
|
23
|
+
# txBAD_AUTH_EXTRA = -10, // unused signatures attached to transaction
|
24
24
|
# txINTERNAL_ERROR = -11 // an unknown error occured
|
25
25
|
# };
|
26
26
|
#
|
data/lib/stellar/base/version.rb
CHANGED
@@ -27,14 +27,14 @@ case ASSET_TYPE_NATIVE: // Not credit
|
|
27
27
|
case ASSET_TYPE_CREDIT_ALPHANUM4:
|
28
28
|
struct
|
29
29
|
{
|
30
|
-
opaque assetCode[4];
|
30
|
+
opaque assetCode[4]; // 1 to 4 characters
|
31
31
|
AccountID issuer;
|
32
32
|
} alphaNum4;
|
33
33
|
|
34
34
|
case ASSET_TYPE_CREDIT_ALPHANUM12:
|
35
35
|
struct
|
36
36
|
{
|
37
|
-
opaque assetCode[12];
|
37
|
+
opaque assetCode[12]; // 5 to 12 characters
|
38
38
|
AccountID issuer;
|
39
39
|
} alphaNum12;
|
40
40
|
|
data/xdr/Stellar-ledger.x
CHANGED
data/xdr/Stellar-overlay.x
CHANGED
@@ -17,9 +17,16 @@ struct Hello
|
|
17
17
|
{
|
18
18
|
uint32 ledgerVersion;
|
19
19
|
uint32 overlayVersion;
|
20
|
+
Hash networkID;
|
20
21
|
string versionStr<100>;
|
21
22
|
int listeningPort;
|
22
23
|
NodeID peerID;
|
24
|
+
uint256 nonce;
|
25
|
+
};
|
26
|
+
|
27
|
+
struct Auth
|
28
|
+
{
|
29
|
+
Signature signature;
|
23
30
|
};
|
24
31
|
|
25
32
|
struct PeerAddress
|
@@ -33,20 +40,21 @@ enum MessageType
|
|
33
40
|
{
|
34
41
|
ERROR_MSG = 0,
|
35
42
|
HELLO = 1,
|
36
|
-
|
43
|
+
AUTH = 2,
|
44
|
+
DONT_HAVE = 3,
|
37
45
|
|
38
|
-
GET_PEERS =
|
39
|
-
PEERS =
|
46
|
+
GET_PEERS = 4, // gets a list of peers this guy knows about
|
47
|
+
PEERS = 5,
|
40
48
|
|
41
|
-
GET_TX_SET =
|
42
|
-
TX_SET =
|
49
|
+
GET_TX_SET = 6, // gets a particular txset by hash
|
50
|
+
TX_SET = 7,
|
43
51
|
|
44
|
-
TRANSACTION =
|
52
|
+
TRANSACTION = 8, // pass on a tx you have heard about
|
45
53
|
|
46
54
|
// SCP
|
47
|
-
GET_SCP_QUORUMSET =
|
48
|
-
SCP_QUORUMSET =
|
49
|
-
SCP_MESSAGE =
|
55
|
+
GET_SCP_QUORUMSET = 9,
|
56
|
+
SCP_QUORUMSET = 10,
|
57
|
+
SCP_MESSAGE = 11
|
50
58
|
};
|
51
59
|
|
52
60
|
struct DontHave
|
@@ -61,6 +69,8 @@ case ERROR_MSG:
|
|
61
69
|
Error error;
|
62
70
|
case HELLO:
|
63
71
|
Hello hello;
|
72
|
+
case AUTH:
|
73
|
+
Auth auth;
|
64
74
|
case DONT_HAVE:
|
65
75
|
DontHave dontHave;
|
66
76
|
case GET_PEERS:
|
data/xdr/Stellar-transaction.x
CHANGED
@@ -436,9 +436,8 @@ enum ManageOfferResultCode
|
|
436
436
|
|
437
437
|
// update errors
|
438
438
|
MANAGE_OFFER_NOT_FOUND = -9, // offerID does not match an existing offer
|
439
|
-
MANAGE_OFFER_MISMATCH = -10, // currencies don't match offer
|
440
439
|
|
441
|
-
MANAGE_OFFER_LOW_RESERVE = -
|
440
|
+
MANAGE_OFFER_LOW_RESERVE = -10 // not enough funds to create a new Offer
|
442
441
|
};
|
443
442
|
|
444
443
|
enum ManageOfferEffect
|
@@ -486,7 +485,8 @@ enum SetOptionsResultCode
|
|
486
485
|
SET_OPTIONS_CANT_CHANGE = -5, // can no longer change this option
|
487
486
|
SET_OPTIONS_UNKNOWN_FLAG = -6, // can't set an unknown flag
|
488
487
|
SET_OPTIONS_THRESHOLD_OUT_OF_RANGE = -7, // bad value for weight/threshold
|
489
|
-
SET_OPTIONS_BAD_SIGNER = -8
|
488
|
+
SET_OPTIONS_BAD_SIGNER = -8, // signer cannot be masterkey
|
489
|
+
SET_OPTIONS_INVALID_HOME_DOMAIN = -9 // malformed home domain
|
490
490
|
};
|
491
491
|
|
492
492
|
union SetOptionsResult switch (SetOptionsResultCode code)
|
@@ -591,7 +591,7 @@ enum OperationResultCode
|
|
591
591
|
{
|
592
592
|
opINNER = 0, // inner object result is valid
|
593
593
|
|
594
|
-
opBAD_AUTH = -1, //
|
594
|
+
opBAD_AUTH = -1, // too few valid signatures / wrong network
|
595
595
|
opNO_ACCOUNT = -2 // source account was not found
|
596
596
|
};
|
597
597
|
|
@@ -637,11 +637,11 @@ enum TransactionResultCode
|
|
637
637
|
txMISSING_OPERATION = -4, // no operation was specified
|
638
638
|
txBAD_SEQ = -5, // sequence number does not match source account
|
639
639
|
|
640
|
-
txBAD_AUTH = -6, //
|
640
|
+
txBAD_AUTH = -6, // too few valid signatures / wrong network
|
641
641
|
txINSUFFICIENT_BALANCE = -7, // fee would bring account below reserve
|
642
642
|
txNO_ACCOUNT = -8, // source account not found
|
643
643
|
txINSUFFICIENT_FEE = -9, // fee is too small
|
644
|
-
txBAD_AUTH_EXTRA = -10, //
|
644
|
+
txBAD_AUTH_EXTRA = -10, // unused signatures attached to transaction
|
645
645
|
txINTERNAL_ERROR = -11 // an unknown error occured
|
646
646
|
};
|
647
647
|
|
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.5.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: 2015-09-
|
11
|
+
date: 2015-09-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: xdr
|
@@ -257,6 +257,7 @@ files:
|
|
257
257
|
- generated/stellar/asset/alpha_num12.rb
|
258
258
|
- generated/stellar/asset/alpha_num4.rb
|
259
259
|
- generated/stellar/asset_type.rb
|
260
|
+
- generated/stellar/auth.rb
|
260
261
|
- generated/stellar/bucket_entry.rb
|
261
262
|
- generated/stellar/bucket_entry_type.rb
|
262
263
|
- generated/stellar/change_trust_op.rb
|
@@ -349,7 +350,6 @@ files:
|
|
349
350
|
- generated/stellar/transaction_history_result_entry.rb
|
350
351
|
- generated/stellar/transaction_history_result_entry/ext.rb
|
351
352
|
- generated/stellar/transaction_meta.rb
|
352
|
-
- generated/stellar/transaction_meta/v0.rb
|
353
353
|
- generated/stellar/transaction_result.rb
|
354
354
|
- generated/stellar/transaction_result/ext.rb
|
355
355
|
- generated/stellar/transaction_result/result.rb
|