This repository has been archived by the owner on Nov 9, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 10
feat(meta_contract): batch create eth accounts #121
Merged
jjyr
merged 2 commits into
godwokenrises:master
from
zeroqn:feat-c-contract-meta-batch-create-eth-accounts
Jul 12, 2022
Merged
feat(meta_contract): batch create eth accounts #121
jjyr
merged 2 commits into
godwokenrises:master
from
zeroqn:feat-c-contract-meta-batch-create-eth-accounts
Jul 12, 2022
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Flouse
approved these changes
Jul 6, 2022
jjyr
approved these changes
Jul 7, 2022
blckngm
reviewed
Jul 7, 2022
blckngm
approved these changes
Jul 11, 2022
Flouse
reviewed
Jul 11, 2022
@@ -109,7 +109,10 @@ int main() { | |||
_gw_fast_memcpy((uint8_t *)(&fee_amount), (uint8_t *)amount_seg.ptr, | |||
sizeof(uint128_t)); | |||
|
|||
uint32_t reg_id = *(uint32_t *)reg_id_seg.ptr; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In c/contracts
dir, there are some other places used this kind of scheme.
c/contracts/eth_addr_reg.c:
108 mol_seg_t reg_id_seg = MolReader_Fee_get_registry_id(&fee_seg);
109: uint32_t reg_id = *(uint32_t *)reg_id_seg.ptr;
110
141 mol_seg_t reg_id_seg = MolReader_Fee_get_registry_id(&fee_seg);
142: uint32_t reg_id = *(uint32_t *)reg_id_seg.ptr;
143
c/contracts/meta_contract.c:
81
82: uint32_t reg_id = *(uint32_t *)reg_id_seg.ptr;
83 ret = handle_fee(&ctx, reg_id, fee_amount);
111
112: uint32_t reg_id = *(uint32_t *)reg_id_seg.ptr;
113 ret = handle_fee(&ctx, reg_id, fee_amount);
c/contracts/sudt.c:
91
92: uint32_t reg_id = *(uint32_t *)fee_reg_seg.ptr;
93 uint32_t from_id = ctx.transaction_context.from_id;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can fix these in different pr.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
New method for meta_contract:
MSG_BATCH_CREATE_ACCOUNTS
https://github.com/nervosnetwork/godwoken-scripts/blob/5d282a632a308f5190171afa49a89a52266c2f5b/c/contracts/meta_contract.c#L102-L159