Skip to content

Commit

Permalink
fix a bug: tendermint => Tendermint
Browse files Browse the repository at this point in the history
  • Loading branch information
classicalliu committed Aug 16, 2018
1 parent a05d0ed commit dd8aa12
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 6 deletions.
2 changes: 1 addition & 1 deletion app/serializers/api/block_serializer.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
class Api::BlockSerializer < ActiveModel::Serializer
attributes :version, :header
attribute :transaction_count, key: :transactions_count
attribute :transaction_count, key: :transactionsCount
attribute :cita_hash, key: :hash
end
4 changes: 3 additions & 1 deletion app/serializers/api/sync_error_serializer.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
class Api::SyncErrorSerializer < ActiveModel::Serializer
attributes :params, :code, :message, :created_at, :updated_at, :data
attributes :params, :code, :message, :data
attribute :method
attribute :created_at, key: :createdAt
attribute :updated_at, key: :updatedAt

def method
object.method
Expand Down
4 changes: 3 additions & 1 deletion app/serializers/api/transaction_serializer.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
class Api::TransactionSerializer < ActiveModel::Serializer
attributes :value, :to, :gas_used, :from, :content, :block_number
attributes :value, :to, :from, :content
attribute :cita_hash, key: :hash
attribute :gas_used, key: :gasUsed
attribute :block_number, key: :blockNumber
attributes :timestamp
end
9 changes: 8 additions & 1 deletion app/serializers/meta_data_serializer.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
class MetaDataSerializer < ActiveModel::Serializer
attributes :chain_id, :chain_name, :operator, :website, :genesis_timestamp, :validators, :block_interval, :token_name, :token_symbol, :token_avatar
attributes :operator, :website, :validators
attribute :chain_id, key: :chainId
attribute :chain_name, key: :chainName
attribute :genesis_timestamp, key: :genesisTimestamp
attribute :block_interval, key: :blockInterval
attribute :token_name, key: :tokenName
attribute :token_symbol, key: :tokenSymbol
attribute :token_avatar, key: :tokenAvatar

end
4 changes: 3 additions & 1 deletion app/serializers/transaction_serializer.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
class TransactionSerializer < ActiveModel::Serializer
attributes :content, :block_number, :block_hash, :index
attributes :content, :index
attribute :block_number, key: :blockNumber
attribute :block_hash, key: :blockHash
attribute :cita_hash, key: :hash
end
2 changes: 1 addition & 1 deletion config/initializers/active_model_serializers.rb
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# ActiveModel::Serializer.config.adapter = :json
ActiveModelSerializers.config.key_transform = :camel_lower
# ActiveModelSerializers.config.key_transform = :camel_lower

0 comments on commit dd8aa12

Please sign in to comment.