Skip to content

Commit

Permalink
feat: using attr_accessor
Browse files Browse the repository at this point in the history
  • Loading branch information
classicalliu committed Jul 15, 2019
1 parent cbea8b2 commit 8d835e3
Show file tree
Hide file tree
Showing 25 changed files with 26 additions and 25 deletions.
2 changes: 1 addition & 1 deletion lib/ckb/types/address_info.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
module CKB
module Types
class AddressInfo
attr_reader :address, :score
attr_accessor :address, :score

# @param address [String]
# @param score [String] number
Expand Down
2 changes: 1 addition & 1 deletion lib/ckb/types/alert_message.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
module CKB
module Types
class AlertMessage
attr_reader :id, :priority, :notice_until, :message
attr_accessor :id, :priority, :notice_until, :message

# @param id [String]
# @param priority [String]
Expand Down
2 changes: 1 addition & 1 deletion lib/ckb/types/block.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
module CKB
module Types
class Block
attr_reader :uncles, :proposals, :transactions, :header
attr_accessor :uncles, :proposals, :transactions, :header

# @param uncles [CKB::Types::Uncle[]]
# @param proposals [String[]] 0x...
Expand Down
2 changes: 1 addition & 1 deletion lib/ckb/types/block_header.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
module CKB
module Types
class BlockHeader
attr_reader :difficulty, :hash, :number, :parent_hash, :seal, :timestamp, :transactions_root, :proposals_hash, \
attr_accessor :difficulty, :hash, :number, :parent_hash, :seal, :timestamp, :transactions_root, :proposals_hash, \
:uncles_count, :uncles_hash, :version, :witnesses_root, :epoch

# @param difficulty [String] 0x...
Expand Down
2 changes: 1 addition & 1 deletion lib/ckb/types/cell_out_point.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
module CKB
module Types
class CellOutPoint
attr_reader :tx_hash, :index
attr_accessor :tx_hash, :index

# @param tx_hash [String] 0x...
# @param index [String] number
Expand Down
2 changes: 1 addition & 1 deletion lib/ckb/types/cell_transaction.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
module CKB
module Types
class CellTransaction
attr_reader :created_by, :consumed_by
attr_accessor :created_by, :consumed_by

# @param created_by [Types::TransactionPoint]
# @param consumed_by [Types::TransactionPoint | nil]
Expand Down
2 changes: 1 addition & 1 deletion lib/ckb/types/cell_with_status.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
module CKB
module Types
class CellWithStatus
attr_reader :cell, :status
attr_accessor :cell, :status

# @param cell [CKB::Types::Output]
# @param status [String]
Expand Down
2 changes: 1 addition & 1 deletion lib/ckb/types/chain_info.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
module CKB
module Types
class ChainInfo
attr_reader :is_initial_block_download, :epoch, :difficulty, :median_time, :chain, :alerts
attr_accessor :is_initial_block_download, :epoch, :difficulty, :median_time, :chain, :alerts

# @param is_initialize_block_download [Boolean]
# @param epoch [String] number
Expand Down
2 changes: 1 addition & 1 deletion lib/ckb/types/dry_run_result.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
module CKB
module Types
class DryRunResult
attr_reader :cycles
attr_accessor :cycles

# @param cycles [String] number
def initialize(cycles:)
Expand Down
2 changes: 1 addition & 1 deletion lib/ckb/types/epoch.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
module CKB
module Types
class Epoch
attr_reader :epoch_reward, :difficulty, :length, :number, :start_number
attr_accessor :epoch_reward, :difficulty, :length, :number, :start_number

# @param epoch_reward [String] number
# @param difficulty [String] 0x...
Expand Down
2 changes: 1 addition & 1 deletion lib/ckb/types/input.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
module CKB
module Types
class Input
attr_reader :previous_output, :since
attr_accessor :previous_output, :since

# @param previous_output [CKB::Types::OutPoint]
# @param since [String]
Expand Down
2 changes: 1 addition & 1 deletion lib/ckb/types/live_cell.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
module CKB
module Types
class LiveCell
attr_reader :cell_output, :created_by
attr_accessor :cell_output, :created_by

# @param cell_output [Types::Output]
# @param created_by [Types::TransactionPoint]
Expand Down
2 changes: 1 addition & 1 deletion lib/ckb/types/lock_hash_index_state.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
module CKB
module Types
class LockHashIndexState
attr_reader :lock_hash, :block_number, :block_hash
attr_accessor :lock_hash, :block_number, :block_hash

# @param lock_hash [String]
# @param block_number [String] number
Expand Down
2 changes: 1 addition & 1 deletion lib/ckb/types/out_point.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
module CKB
module Types
class OutPoint
attr_reader :block_hash, :cell
attr_accessor :block_hash, :cell

# @param block_hash [String | nil] 0x...
# @param cell [CKB::Types::CellOutPoint | nil]
Expand Down
3 changes: 2 additions & 1 deletion lib/ckb/types/output.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
module CKB
module Types
class Output
attr_reader :data, :lock, :type, :out_point, :capacity
attr_accessor :data, :lock, :type, :out_point
attr_reader :capacity

# @param capacity [String]
# @param data: [String] 0x...
Expand Down
2 changes: 1 addition & 1 deletion lib/ckb/types/peer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
module CKB
module Types
class Peer
attr_reader :addresses, :is_outbound, :node_id, :version
attr_accessor :addresses, :is_outbound, :node_id, :version

# @param addresses [AddressInfo[]]
# @param is_outbound [Boolean]
Expand Down
2 changes: 1 addition & 1 deletion lib/ckb/types/peer_state.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
module CKB
module Types
class PeerState
attr_reader :last_updated, :blocks_in_flight, :peer
attr_accessor :last_updated, :blocks_in_flight, :peer

# @param last_updated [String]
# @param block_in_flight [String] number
Expand Down
2 changes: 1 addition & 1 deletion lib/ckb/types/script.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
module CKB
module Types
class Script
attr_reader :code_hash, :args, :hash_type
attr_accessor :code_hash, :args, :hash_type

# @param code_hash [String]
# @param args [String[]]
Expand Down
2 changes: 1 addition & 1 deletion lib/ckb/types/seal.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
module CKB
module Types
class Seal
attr_reader :nonce, :proof
attr_accessor :nonce, :proof

# @param nonce [String] decimal number
# @param proof [String] 0x...
Expand Down
2 changes: 1 addition & 1 deletion lib/ckb/types/transaction.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
module CKB
module Types
class Transaction
attr_reader :version, :deps, :inputs, :outputs, :witnesses, :hash
attr_accessor :version, :deps, :inputs, :outputs, :witnesses, :hash

# @param hash [String | nil] 0x...
# @param version [String]
Expand Down
2 changes: 1 addition & 1 deletion lib/ckb/types/transaction_point.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
module CKB
module Types
class TransactionPoint
attr_reader :block_number, :tx_hash, :index
attr_accessor :block_number, :tx_hash, :index

# @param block_number [String]
# @param tx_hash [String]
Expand Down
2 changes: 1 addition & 1 deletion lib/ckb/types/transaction_with_status.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
module CKB
module Types
class TransactionWithStatus
attr_reader :transaction, :tx_status
attr_accessor :transaction, :tx_status

# @param transaction [CKB::Types::Transaction]
# @param tx_status [CKB::Types::TxStatus]
Expand Down
2 changes: 1 addition & 1 deletion lib/ckb/types/tx_pool_info.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
module CKB
module Types
class TxPoolInfo
attr_reader :pending, :proposed, :orphan, :total_tx_cycles, :total_tx_size, :last_txs_updated_at
attr_accessor :pending, :proposed, :orphan, :total_tx_cycles, :total_tx_size, :last_txs_updated_at

# @param pending [String] number
# @param proposed [String] number
Expand Down
2 changes: 1 addition & 1 deletion lib/ckb/types/tx_status.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
module CKB
module Types
class TxStatus
attr_reader :status, :block_hash
attr_accessor :status, :block_hash

# @param status [String] "proposed", "pending", "committed"
# @param block_hash [String | nil] "0x..."
Expand Down
2 changes: 1 addition & 1 deletion lib/ckb/types/uncle.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
module CKB
module Types
class Uncle
attr_reader :proposals, :header
attr_accessor :proposals, :header

# @param proposals [String[]] 0x..
# @param header [CKB::Type::BlockHeader]
Expand Down

0 comments on commit 8d835e3

Please sign in to comment.