-
Notifications
You must be signed in to change notification settings - Fork 53
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
refactor(examples): secp256k1 transfer example #388
base: develop
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Codecov Report
@@ Coverage Diff @@
## develop #388 +/- ##
===========================================
+ Coverage 81.94% 82.13% +0.18%
===========================================
Files 93 94 +1
Lines 19003 19269 +266
Branches 1785 1820 +35
===========================================
+ Hits 15572 15826 +254
- Misses 3390 3401 +11
- Partials 41 42 +1
Continue to review full report at Codecov.
|
6e14630
to
a13ceb8
Compare
644af4a
to
8a0363c
Compare
8a0363c
to
f7416d0
Compare
f7416d0
to
19fffb8
Compare
19fffb8
to
8e4b75c
Compare
8e4b75c
to
95bdde3
Compare
can you please upgrade the example to [email protected]? checkout the migration guide |
IMO, as an example, it should be linear, procedural. Modular for engineering but not for viewing, especially for a web app like GitHub, which would require more memory if I had to jump between multiple methods. Can you please refactor function transfer(options: {
recipients: Array<{address: Address, capacity: BIish}>,
senderPrivkey: BytesLike
}): Promise<Hash> {
// step 1 - convert a privkey to an lock(address)
// step 2 - caculate the total capacity to be transferred
// step 3 - call common.transfer to generate a txSkeleton
// step 4 - pay tx fee
// step 5 - prepare signing entries
// step 6 - seal the transaction
// step 7 - broadcast the transfer tx
}
|
However, we need show the transaction fee. So we have to split the whole transfer into differient part. |
35a29d1
to
3a421e8
Compare
3a421e8
to
579677f
Compare
Description
The origin secp256k1 transfer example is too hard to understand. because it builds up the transaction mannually. In current lumos version, we have
commons.common.transfer
method, which can manipulate the raw transaction's inputs/outputs. Thus, it's a time for reactoring it. And I add a new feature, which allows developer can transfer CKB to mulitple addressesType of change
[x] other