This repository was archived by the owner on Sep 3, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 7 files changed +108
-0
lines changed
Expand file tree Collapse file tree 7 files changed +108
-0
lines changed Original file line number Diff line number Diff line change 1414/.vscode
1515mkmf.log
1616.DS_Store
17+ .idea
Original file line number Diff line number Diff line change 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 BumpSequenceOp
9+ # {
10+ # SequenceNumber bumpTo;
11+ # };
12+ #
13+ # ===========================================================================
14+ module Stellar
15+ class BumpSequenceOp < XDR ::Struct
16+ attribute :bump_to , SequenceNumber
17+ end
18+ end
Original file line number Diff line number Diff line change 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 BumpSequenceResult switch (BumpSequenceResultCode code)
9+ # {
10+ # case BUMP_SEQUENCE_SUCCESS:
11+ # void;
12+ # default:
13+ # void;
14+ # };
15+ #
16+ # ===========================================================================
17+ module Stellar
18+ class BumpSequenceResult < XDR ::Union
19+ switch_on BumpSequenceResultCode , :code
20+
21+ switch :bump_sequence_success
22+ switch :default
23+
24+ end
25+ end
Original file line number Diff line number Diff line change 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 BumpSequenceResultCode
9+ # {
10+ # // codes considered as "success" for the operation
11+ # BUMP_SEQUENCE_SUCCESS = 0,
12+ # // codes considered as "failure" for the operation
13+ # BUMP_SEQUENCE_BAD_SEQ = -1 // `bumpTo` is not within bounds
14+ # };
15+ #
16+ # ===========================================================================
17+ module Stellar
18+ class BumpSequenceResultCode < XDR ::Enum
19+ member :bump_sequence_success , 0
20+ member :bump_sequence_bad_seq , -1
21+
22+ seal
23+ end
24+ end
Original file line number Diff line number Diff line change 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 TransactionMetaV1
9+ # {
10+ # LedgerEntryChanges txChanges; // tx level changes if any
11+ # OperationMeta operations<>; // meta for each operation
12+ # };
13+ #
14+ # ===========================================================================
15+ module Stellar
16+ class TransactionMetaV1 < XDR ::Struct
17+ attribute :tx_changes , LedgerEntryChanges
18+ attribute :operations , XDR ::VarArray [ OperationMeta ]
19+ end
20+ end
Original file line number Diff line number Diff line change @@ -308,6 +308,20 @@ def self.manage_data(attributes={})
308308 } ) )
309309 end
310310
311+ def self . bump_sequence ( attributes = { } )
312+ op = BumpSequenceOp . new ( )
313+
314+ bump_to = attributes [ :bump_to ]
315+
316+ raise ArgumentError , ":bump_to too big" unless bump_to <= MAX_INT64
317+
318+ op . bump_to = bump_to
319+
320+ return make ( attributes . merge ( {
321+ body :[ :bump_sequence , op ]
322+ } ) )
323+ end
324+
311325 private
312326 def self . extract_amount ( a )
313327 amount = interpret_amount ( a . last )
Original file line number Diff line number Diff line change @@ -67,6 +67,12 @@ def self.manage_data(attributes={})
6767 make :manage_data , attributes
6868 end
6969
70+ #
71+ # @see Stellar::Operation.manage_data
72+ def self . bump_sequence ( attributes = { } )
73+ make :bump_sequence , attributes
74+ end
75+
7076 #
7177 # Helper method to create a transaction with a single
7278 # operation of the provided type. See class methods
You can’t perform that action at this time.
0 commit comments