-
Notifications
You must be signed in to change notification settings - Fork 249
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
chore(wallet-community)_: Move community minting airdrop to router #6196
chore(wallet-community)_: Move community minting airdrop to router #6196
Conversation
Jenkins BuildsClick to see older builds (208)
|
45dd4c2
to
00a5a5f
Compare
78f7468
to
2757af4
Compare
5c0877e
to
8c002e3
Compare
559773a
to
87cf27f
Compare
Codecov ReportAttention: Patch coverage is
❌ Your patch status has failed because the patch coverage (21.73%) is below the target coverage (50.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## move-community-minting-airdrop-to-router-pre-step-2 #6196 +/- ##
========================================================================================
+ Coverage 0 61.86% +61.86%
========================================================================================
Files 0 849 +849
Lines 0 111406 +111406
========================================================================================
+ Hits 0 68918 +68918
- Misses 0 34514 +34514
- Partials 0 7974 +7974
Flags with carried forward coverage won't be shown. Click here to find out more.
|
87cf27f
to
3394343
Compare
Could you change the base to be on top of #6261, that way we don't have to review that commit twice. Thanks |
3394343
to
37aeb40
Compare
6dcc4bd
to
d442b09
Compare
37aeb40
to
68b2bae
Compare
d442b09
to
e958ef0
Compare
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.
I am sorry @saledjenic. I'm approving, but I didn't really read the code.
I've never seen this community tokens code before, neither I know the wallet code. Investigating huge changes in the code that's new to me makes no sense. I will spend too much time and doubt I'll find a single bug (I tried though).
|
||
func NewCommunityTokensContractMakerMaker(client rpc.ClientInterface) (*CommunityTokensContractMaker, error) { | ||
if client == nil { | ||
return nil, errors.New("could not initialize CommunityTokensContractMaker with an rpc client") |
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.
return nil, errors.New("could not initialize CommunityTokensContractMaker with an rpc client") | |
return nil, errors.New("rpc client is required") |
services/communitytokens/service.go
Outdated
@@ -142,7 +142,7 @@ func (s *Service) handleWalletEvent(event walletevent.Event) { | |||
errorStr = tokenErr.Error() | |||
} | |||
|
|||
signal.SendCommunityTokenTransactionStatusSignal(string(pendingTransaction.Type), p.Status == transactions.Success, pendingTransaction.Hash, | |||
signal.SendCommunityTokenTransactionStatusSignal(0, p.Status == transactions.Success, pendingTransaction.Hash, |
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.
What is 0
? Can we please define this as constant?
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.
Hey, that's most likely due to selecting lines that will go to this PR. You can see that it looks differently in the follow-up PR, here https://github.com/status-im/status-go/pull/6263/files#diff-e86ab0fc741a1f8cf5d8ac362ce33a75e1eaff3fc2bf142671291cccc5da087cR142
transactions/transactor.go
Outdated
var toAddress common.Address | ||
if tx.To() != nil { | ||
toAddress = *tx.To() | ||
} else { | ||
toAddr := crypto.CreateAddress(types.Address(from), tx.Nonce()) | ||
toAddress = common.Address(toAddr) | ||
} |
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.
Can you please add a comment to the code why we do this?
Maybe it's because I'm not from the wallet world, but I don't get the logic.
68b2bae
to
587ca54
Compare
…outer - new file `contracts/community-tokens/contracts.go` added to unify contracts creation - the following community related path processors added: - `CommunityBurnProcessor` - `CommunityDeployAssetsProcessor` - `CommunityDeployCollectiblesProcessor` - `CommunityDeployOwnerTokenProcessor` - `CommunityMintTokensProcessor` - `CommunityRemoteBurnProcessor` - `CommunitySetSignerPubKeyProcessor` - `SendType` extended with appropriate options - added endpoints to duplicated `communitytokens` api: - `StoreDeployedCollectibles` - `StoreDeployedOwnerToken` - `StoreDeployedAssets` - removed endpoints from duplicated `communitytokens` api: - `DeployCollectibles` - `DeployOwnerToken` - `ReTrackOwnerTokenDeploymentTransaction` - `DeployAssets` - `DeployCollectiblesEstimate` - `DeployAssetsEstimate` - `DeployOwnerTokenEstimate` - `EstimateMintTokens` - `EstimateRemoteBurn` - `EstimateBurn` - `EstimateSetSignerPubKey` - `NewOwnerTokenInstance` - `NewCommunityTokenDeployerInstance` - `NewCommunityOwnerTokenRegistryInstance` - `NewCollectiblesInstance` - `NewAssetsInstance` - `MintTokens` - `RemoteBurn` - `GetCollectiblesContractInstance` - `GetAssetContractInstance` - `Burn` - `SetSignerPubKey` - `Path` type extended with new property: - `UsedContractAddress` - an address of the contract that will be used for the transaction
e958ef0
to
45fb56c
Compare
@@ -483,13 +121,9 @@ func (api *API) SafeGetOwnerTokenAddress(ctx context.Context, chainID uint64, co | |||
return api.s.SafeGetOwnerTokenAddress(ctx, chainID, communityID) | |||
} | |||
|
|||
func (api *API) SetSignerPubKey(ctx context.Context, chainID uint64, contractAddress string, txArgs wallettypes.SendTxArgs, password string, newSignerPubKey string) (string, error) { |
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.
I see this disappeared, was it not used in the client?
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.
@dlipicar correct, it's not used as an explicit API endpoint but goes over the router now.
This is a breaking change which removes `communitytokens` package. This commit removes old `communitytokens` package, cause previously added `communitytokensv2` package, which is in use now, will be renamed to `communitytokens` in next commit.
This is a breaking change which renames `communitytokensv2` package to `communitytokens`.
805e77f
into
move-community-minting-airdrop-to-router-pre-step-2
Looks like you have BREAKING CHANGES in your PR. Check-list
|
This is the main PR in moving community-related transactions from
communitytokens
towallet
service and aligning the sending flow across the app.Related PRs:
Changes done in this PR:
new file
contracts/community-tokens/contracts.go
added to unify contracts creationthe following community related path processors added:
CommunityBurnProcessor
CommunityDeployAssetsProcessor
CommunityDeployCollectiblesProcessor
CommunityDeployOwnerTokenProcessor
CommunityMintTokensProcessor
CommunityRemoteBurnProcessor
CommunitySetSignerPubKeyProcessor
SendType
extended with appropriate optionsadded endpoints to duplicated
communitytokens
API:StoreDeployedCollectibles
StoreDeployedOwnerToken
StoreDeployedAssets
removed endpoints from duplicated
communitytokens
API:DeployCollectibles
DeployOwnerToken
ReTrackOwnerTokenDeploymentTransaction
DeployAssets
DeployCollectiblesEstimate
DeployAssetsEstimate
DeployOwnerTokenEstimate
EstimateMintTokens
EstimateRemoteBurn
EstimateBurn
EstimateSetSignerPubKey
NewOwnerTokenInstance
NewCommunityTokenDeployerInstance
NewCommunityOwnerTokenRegistryInstance
NewCollectiblesInstance
NewAssetsInstance
MintTokens
RemoteBurn
GetCollectiblesContractInstance
GetAssetContractInstance
Burn
SetSignerPubKey
Path
type extended with new property:UsedContractAddress
- an address of the contract that will be used for the transaction