glueby 0.4.3 → 0.4.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,40 +1,40 @@
1
- module Glueby
2
- module Contract
3
- module Task
4
- module Timestamp
5
- module_function
6
- extend Glueby::Contract::TxBuilder
7
- extend Glueby::Contract::Timestamp::Util
8
-
9
- def create
10
- timestamps = Glueby::Contract::AR::Timestamp.where(status: :init)
11
- timestamps.each do |t|
12
- begin
13
- ::ActiveRecord::Base.transaction do
14
- wallet = Glueby::Wallet.load(t.wallet_id)
15
- tx = create_tx(wallet, t.prefix, t.content_hash, Glueby::Contract::FixedFeeEstimator.new)
16
- wallet.internal_wallet.broadcast(tx) do |tx|
17
- t.update(txid: tx.txid, status: :unconfirmed)
18
- end
19
- puts "broadcasted (id=#{t.id}, txid=#{tx.txid})"
20
- end
21
- rescue => e
22
- puts "failed to broadcast (id=#{t.id}, reason=#{e.message})"
23
- end
24
- end
25
- end
26
- end
27
- end
28
- end
29
- end
30
-
31
- namespace :glueby do
32
- namespace :contract do
33
- namespace :timestamp do
34
- desc 'create and broadcast glueby timestamp tx'
35
- task :create, [] => [:environment] do |_, _|
36
- Glueby::Contract::Task::Timestamp.create
37
- end
38
- end
39
- end
1
+ module Glueby
2
+ module Contract
3
+ module Task
4
+ module Timestamp
5
+ module_function
6
+ extend Glueby::Contract::TxBuilder
7
+ extend Glueby::Contract::Timestamp::Util
8
+
9
+ def create
10
+ timestamps = Glueby::Contract::AR::Timestamp.where(status: :init)
11
+ timestamps.each do |t|
12
+ begin
13
+ ::ActiveRecord::Base.transaction do
14
+ wallet = Glueby::Wallet.load(t.wallet_id)
15
+ tx = create_tx(wallet, t.prefix, t.content_hash, Glueby::Contract::FixedFeeEstimator.new)
16
+ wallet.internal_wallet.broadcast(tx) do |tx|
17
+ t.update(txid: tx.txid, status: :unconfirmed)
18
+ end
19
+ puts "broadcasted (id=#{t.id}, txid=#{tx.txid})"
20
+ end
21
+ rescue => e
22
+ puts "failed to broadcast (id=#{t.id}, reason=#{e.message})"
23
+ end
24
+ end
25
+ end
26
+ end
27
+ end
28
+ end
29
+ end
30
+
31
+ namespace :glueby do
32
+ namespace :contract do
33
+ namespace :timestamp do
34
+ desc 'create and broadcast glueby timestamp tx'
35
+ task :create, [] => [:environment] do |_, _|
36
+ Glueby::Contract::Task::Timestamp.create
37
+ end
38
+ end
39
+ end
40
40
  end
@@ -1,18 +1,18 @@
1
- namespace :glueby do
2
- namespace :fee_provider do
3
- desc 'Manage the UTXO pool in Glueby::FeeProvider. Creates outputs for paying fee if the outputs is less than configured pool size by :utxo_pool_size'
4
- task :manage_utxo_pool, [] => [:environment] do |_, _|
5
- Glueby::FeeProvider::Tasks.new.manage_utxo_pool
6
- end
7
-
8
- desc 'Show the status of the UTXO pool in Glueby::FeeProvider'
9
- task :status, [] => [:environment] do |_, _|
10
- Glueby::FeeProvider::Tasks.new.status
11
- end
12
-
13
- desc 'Show the address of the Glueby::FeeProvider'
14
- task :address, [] => [:environment] do |_, _|
15
- Glueby::FeeProvider::Tasks.new.address
16
- end
17
- end
18
- end
1
+ namespace :glueby do
2
+ namespace :fee_provider do
3
+ desc 'Manage the UTXO pool in Glueby::FeeProvider. Creates outputs for paying fee if the outputs is less than configured pool size by :utxo_pool_size'
4
+ task :manage_utxo_pool, [] => [:environment] do |_, _|
5
+ Glueby::FeeProvider::Tasks.new.manage_utxo_pool
6
+ end
7
+
8
+ desc 'Show the status of the UTXO pool in Glueby::FeeProvider'
9
+ task :status, [] => [:environment] do |_, _|
10
+ Glueby::FeeProvider::Tasks.new.status
11
+ end
12
+
13
+ desc 'Show the address of the Glueby::FeeProvider'
14
+ task :address, [] => [:environment] do |_, _|
15
+ Glueby::FeeProvider::Tasks.new.address
16
+ end
17
+ end
18
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: glueby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.3
4
+ version: 0.4.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - azuchi
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-09-02 00:00:00.000000000 Z
11
+ date: 2021-09-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: tapyrus