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

Config: AssetEnabled upgrade #1735

Open
wants to merge 11 commits into
base: master
Choose a base branch
from

Conversation

gbjk
Copy link
Collaborator

@gbjk gbjk commented Nov 29, 2024

Config:

  • Moves AssetEnabled from being a bool pointer to just being a bool

Exchanges:

  • Rename StoreAssetPairFormat to StoreAssetPairStore
  • StorePairs(enabled) set assetEnabled if pairs list is not empty
  • StorePairs(enabled) add pairs to Available as well
    • This is a convenience for all the test that have to do both, as well as users. Can be dropped if contentious
  • Fix error formatting for DisableAssetWebsocketSupport logging
  • Various assertifications in tests
  • Simplify exchange's defaultPairFormatting handling and make it somewhat consistent.
    • Could do more, but there's a larger overhaul of this coming
  • SetAssetEnabled will not error on no-op (already disabled or enabled)

Bitfinex:

  • Fix tests for MarginFunding subs

Type of change

Please delete options that are not relevant and add an x in [] as item is complete.

  • New feature (non-breaking change which adds functionality)

How has this been tested

  • go test ./... -race
  • golangci-lint run

@gbjk gbjk self-assigned this Nov 29, 2024
@gbjk gbjk requested a review from thrasher- November 29, 2024 06:19
@gbjk gbjk added the review me This pull request is ready for review label Nov 29, 2024
@gbjk gbjk force-pushed the feature/config_assetenabled branch 2 times, most recently from 3697ede to 5fb08d2 Compare November 30, 2024 06:05
@gloriousCode gloriousCode added the nomerge requires dependency This pull request is dependent on another, so it can't be merged until the dependent one is merged label Dec 1, 2024
@gbjk gbjk force-pushed the feature/config_assetenabled branch from 026f88f to 272827a Compare December 2, 2024 01:28
@gbjk gbjk mentioned this pull request Dec 4, 2024
3 tasks
@gbjk gbjk force-pushed the feature/config_assetenabled branch from 942b49b to e2d81d0 Compare December 9, 2024 08:13
@gbjk gbjk removed the nomerge requires dependency This pull request is dependent on another, so it can't be merged until the dependent one is merged label Dec 9, 2024
gbjk added 10 commits December 11, 2024 09:10
This became more messy with Disabling something that's defaulted to
disabled.
Taking an idealogical stance against erroring that what you want to have
done is already done.
Previously we were calling it "Format", but accepting everything from
the PairStore.
We were also defaulting to turning the Asset on.

Now callers need to get their AssetEnabled set as they want it, so
there's no magic

This change also moves responsibility for error wrapping outside to the
caller.
Previously we ignored the field and just turned on everything.
I think that was because we couldn't get at the old value.
In either case, we have the option to do better, and respect the
assetEnabled value
Copy link
Collaborator

@shazbert shazbert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Quick test on gateio, when I set everything but spot assets to false for asset enabled it still fetches and subscribes all assets. Doesn't seem to be happening on master, once resolved I will do a more in-depth check.

@gbjk gbjk force-pushed the feature/config_assetenabled branch from c092bfa to 65c05a0 Compare December 13, 2024 03:28
@gbjk
Copy link
Collaborator Author

gbjk commented Dec 13, 2024

Quick test on gateio, when I set everything but spot assets to false for asset enabled it still fetches and subscribes all assets. Doesn't seem to be happening on master, once resolved I will do a more in-depth check.

Fixed gbjk@65c05a063

@gbjk gbjk force-pushed the feature/config_assetenabled branch from 65c05a0 to 4a4fb99 Compare December 13, 2024 03:44
@gbjk gbjk mentioned this pull request Dec 17, 2024
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
review me This pull request is ready for review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants