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

Use Bitcoin types everywhere #262

Open
4 tasks
KnowWhoami opened this issue Sep 8, 2024 · 14 comments
Open
4 tasks

Use Bitcoin types everywhere #262

KnowWhoami opened this issue Sep 8, 2024 · 14 comments
Labels
enhancement This enhances the code and improves stuffs
Milestone

Comments

@KnowWhoami
Copy link
Collaborator

KnowWhoami commented Sep 8, 2024

  • While updating our rust-bitcoin dependency, we attempted to replace all primitive types with the alternative rust-bitcoin types in update bitcoin to v0.32 #182.
    But there are many places still left to apply these changes , thus created subtasks for them.
  • Use Amount type for denoting Bitcoin amounts instead of plain u64.

  • Use FeeRate type for fee-rate.

  • Use locktime::relative::LockTime for denoting relative locktime instead of u16.

  • Use BlockHeight for denoting the height of a block.

@KnowWhoami KnowWhoami added the enhancement This enhances the code and improves stuffs label Sep 8, 2024
@KnowWhoami
Copy link
Collaborator Author

IMO, I have covered all basic structs , though I will add new subtasks in case if found any.

@KnowWhoami KnowWhoami added this to the v0.1.1 milestone Oct 16, 2024
@A-y-ush
Copy link

A-y-ush commented Oct 21, 2024

Hey @KnowWhoami I would like to work on this issue. Can I be assigned to it ?

@KnowWhoami
Copy link
Collaborator Author

Go ahead.
We will assign you once you come with your pr.

@Shash-Projects
Copy link

@KnowWhoami , Do we need to make these type changes across all the files ?

@mojoX911
Copy link

Yes this should be applied across all modules in the lib wherever applicable.

@Shash-Projects
Copy link

Can you please tell me whether the fee_rate is in satoshi per virtual byte (sat_per_vb) or per kilo virtual byte (sat_per_kvb) ?

@mojoX911
Copy link

mojoX911 commented Dec 23, 2024

sats_per_vb would be preferred.

@KnowWhoami
Copy link
Collaborator Author

Can you please tell me whether the fee_rate is in satoshi per virtual byte (sat_per_vb) or per kilo virtual byte (sat_per_kvb) ?

sats_per_vb would be preferred.

No, Rust-bitcoin have a dedicated struct FeeRate for representing fee rate in sat/(kilo weight unit).
Just use that struct instead.

@Shash-Projects
Copy link

Yes, but the FreeRate struct offers two methods: sat per vbyte and other sat per kilo vbyte. Should i go with per kilo vbyte?

@mojoX911
Copy link

Any one of them works. I would go for sat per vbyte as thats the defacto unit used in most places. And we will use that or our apps too.

@Shash-Projects
Copy link

Can you please review the pr#342 and notify the changes that need to be made ?

@KnowWhoami
Copy link
Collaborator Author

looking into #342

@Shash-Projects
Copy link

I think i can start working on this issue again. Should i open independent pr for updating types of amount, feeRate, locktime or just a single pr after making all the changes?

@KnowWhoami
Copy link
Collaborator Author

Single pr works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement This enhances the code and improves stuffs
Projects
Status: No status
Development

No branches or pull requests

4 participants