-
Notifications
You must be signed in to change notification settings - Fork 91
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
client/asset/eth: less provider check spam #2159
Conversation
f9b0467
to
a203a03
Compare
Compared to #2158, it now looks like:
|
The compatibility tests weren't supposed to be logging at all outside of tests ( |
This quiets down the logs from the RPC provider compatibility tests, which was only supposed to be enable for testing and debugging. This also removes a duplicate check for PendingNonceAt. This also removes the redundant sublogger so that CORE[eth][ETH] becomes just CORE[eth]. Same on server. Finally, the changes the subloger used by CreateWallet not be CORE[CREATE], and instead just show the asset symbol.
a203a03
to
3675ba0
Compare
@@ -697,7 +696,7 @@ func createAndCheckProviders(ctx context.Context, walletDir string, endpoints [] | |||
if len(providers) != len(unknownEndpoints) { | |||
return providersErr(providers) | |||
} | |||
if err := checkProvidersCompliance(ctx, providers, net, log); err != nil { | |||
if err := checkProvidersCompliance(ctx, providers, net, dex.Disabled /* logger is for testing only */); err != nil { |
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.
Could do this when calling createAndCheckProviders
, but that's only used in product code, whereas the tests use checkProvidersCompliance
directly.
Happy to change.
EDIT: There are some logs up there we probably would want.
default: // caller should have checked though | ||
panic(fmt.Sprintf("Unknown net %v in compatibility tests. Testing data not initiated.", net)) |
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 the product code, there are probably 30 places it would panic before getting here anyway. It's virtually impossible to get an unrecognized dex.Network
here with the product where it's checked first thing on app bring-up.
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.
Looks way nicer. I don't think it would be bad to leave the logger on if everything is debug level though.. you could even make it trace.
Just pushed an inconsequential commit to remove "geth" from a few spots where it's no longer right. There was also some needless bloat in |
15ad2fa
to
3428fd9
Compare
@@ -3947,7 +3939,8 @@ func (w *assetWallet) estimateTransferGas(val uint64) (gas uint64, err error) { | |||
|
|||
// redeem redeems a swap contract. Any on-chain failure, such as this secret not | |||
// matching the hash, will not cause this to error. | |||
func (w *assetWallet) redeem(ctx context.Context, assetID uint32, redemptions []*asset.Redemption, maxFeeRate, gasLimit uint64, contractVer uint32, nonceOverride *uint64) (tx *types.Transaction, err error) { | |||
func (w *assetWallet) redeem(ctx context.Context, assetID uint32 /* ?? */, redemptions []*asset.Redemption, |
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 don't know what this input parameter is about. Should it have been used or was this copy pasta from other methods like this?
Resolves #2158
This also resolves the missing parent path for the compliant providers json file on initial wallet creation.