Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add FeeProvider #54

Merged
merged 5 commits into from
May 27, 2021
Merged

Add FeeProvider #54

merged 5 commits into from
May 27, 2021

Conversation

rantan
Copy link
Contributor

@rantan rantan commented May 25, 2021

This PR adds FeeProvider feature

What this PR doesn't do(and it going to be another PRs)

  • Add glueby:fee_provider:manage_utxo_pool rake task
  • Add glueby:fee_provider:status rake task

@rantan rantan requested a review from azuchi May 25, 2021 08:33
@rantan rantan marked this pull request as ready for review May 25, 2021 08:34
lib/glueby/fee_provider.rb Show resolved Hide resolved
lib/glueby/fee_provider.rb Outdated Show resolved Hide resolved
lib/glueby/fee_provider.rb Show resolved Hide resolved
spec/glueby/fee_provider_spec.rb Show resolved Hide resolved
@rantan rantan force-pushed the add_fee_provider_2 branch from 25ca54a to b6280e6 Compare May 26, 2021 05:51
rantan added 4 commits May 26, 2021 16:04
…threads.

There is a possibility of conflicts even if it is applied this change.
We should consider more serious exclusive control like using Mutex or RDB atomicity.
@rantan rantan force-pushed the add_fee_provider_2 branch from b6280e6 to 5bea5f7 Compare May 26, 2021 08:01
@rantan rantan requested a review from azuchi May 26, 2021 08:10
class FeeProvider
include Singleton

class NoUtxosInUtxoPool < StandardError; end
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NoUtxosInUtxoPool is a word inside FeeProvider, so it is desirable to have a word that users can understand, like InsufficientFee.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

今の作り方だと、UTXO pool についてユーザには意識してもらう必要がどうしてもあるかと思います。poolが枯渇しないように管理するのはユーザの責任担ってしまうので。もちろんそのための rake タスク等は用意しますが。

UTXOについて完全にユーザに意識させないようにするには、別のアプローチを考える必要があると思います。

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

APIとかで使う場合は、これらをキャッチして別のエラーとして返すという認識ですか?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

そうですね。APIで使う場合にこのエラーが出たら 500 番台のエラーになると思いますし、リカバリは API 側の責任かと思います。

@azuchi azuchi merged commit 103f523 into chaintope:master May 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants