-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
135 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
module CKB | ||
module Types | ||
class TxPoolIds | ||
attr_accessor :pending, :proposed | ||
|
||
# @param pending [String] | ||
# @param proposed [String] | ||
def initialize(pending:, proposed:) | ||
@pending = pending | ||
@proposed = proposed | ||
end | ||
|
||
def to_h | ||
{ | ||
pending: pending, | ||
proposed: proposed | ||
} | ||
end | ||
|
||
def self.from_h(hash) | ||
return if hash.nil? | ||
|
||
new( | ||
pending: hash[:pending], | ||
proposed: hash[:proposed] | ||
) | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
module CKB | ||
module Types | ||
class TxPoolVerbosity | ||
attr_accessor :pending, :proposed | ||
|
||
# @param pending [Hash] | ||
# @param proposed [Hash] | ||
def initialize(pending:, proposed:) | ||
@pending = pending | ||
@proposed = proposed | ||
end | ||
|
||
def to_h | ||
{ | ||
pending: pending, | ||
proposed: proposed | ||
} | ||
end | ||
|
||
def self.from_h(hash) | ||
return if hash.nil? | ||
|
||
new( | ||
pending: hash[:pending].map { |k, v| [k, TxVerbosity.from_h(v)] }.to_h, | ||
proposed: hash[:proposed].map { |k, v| [k, TxVerbosity.from_h(v)] }.to_h | ||
) | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
module CKB | ||
module Types | ||
class TxVerbosity | ||
attr_accessor :cycles, :size, :fee, :ancestors_size, :ancestors_cycles, :ancestors_count | ||
|
||
# @param cycles [String | Integer] | ||
# @param size [String | Integer] | ||
# @param fee [String | Integer] | ||
# @param ancestors_size [String | Integer] | ||
# @param ancestors_cycles [String | Integer] | ||
# @param ancestors_count [String | Integer] | ||
# @param | ||
def initialize(cycles:, size:, fee:, ancestors_size:, ancestors_cycles:, ancestors_count:) | ||
@cycles = Utils.to_int(cycles) | ||
@size = Utils.to_int(size) | ||
@fee = Utils.to_int(fee) | ||
@ancestors_size = Utils.to_int(ancestors_size) | ||
@ancestors_cycles = Utils.to_int(ancestors_cycles) | ||
@ancestors_count = Utils.to_int(ancestors_count) | ||
end | ||
|
||
def to_h | ||
{ | ||
cycles: Utils.to_hex(cycles), | ||
size: Utils.to_hex(size), | ||
fee: Utils.to_hex(fee), | ||
ancestors_size: Utils.to_hex(ancestors_size), | ||
ancestors_cycles: Utils.to_hex(ancestors_cycles), | ||
ancestors_count: Utils.to_hex(ancestors_count) | ||
} | ||
end | ||
|
||
def self.from_h(hash) | ||
return if hash.nil? | ||
|
||
new( | ||
cycles: hash[:cycles], | ||
size: hash[:size], | ||
fee: hash[:fee], | ||
ancestors_size: hash[:ancestors_size], | ||
ancestors_cycles: hash[:ancestors_cycles], | ||
ancestors_count: hash[:ancestors_count] | ||
) | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters