Method: Hive::Broadcast.feed_publish
- Defined in:
- lib/hive/broadcast.rb
.feed_publish(options, &block) ⇒ Object
Feeds can only be published by the top N witnesses which are included in every round and are used to define the exchange rate between hive and the dollar.
414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 |
# File 'lib/hive/broadcast.rb', line 414 def self.feed_publish(, &block) required_fields = %i(publisher exchange_rate) params = [:params] check_required_fields(params, *required_fields) exchange_rate = params[:exchange_rate] rescue nil || {} base = exchange_rate[:base] quote = exchange_rate[:quote] params[:exchange_rate][:base] = normalize_amount(.merge amount: base) params[:exchange_rate][:quote] = normalize_amount(.merge amount: quote) ops = [[:feed_publish, params]] process(.merge(ops: ops), &block) end |