-
Notifications
You must be signed in to change notification settings - Fork 77
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
Equality operation for new symbols is not working. #89
Comments
Adding code for copy-paste:
|
Oh man. Implicit string conversion is working based on the Line 349 in a2d4362
So I have to update cache first and then make comparing. So if i have the new symbols now - comparing symbol with string is not working as expected. It's a really confusing. |
For issue #89. Update Symbol unit tests. Update versions. Update static assets and symbols.
@sguryev, yes, the string-to-Symbol conversion uses the Cache. I have removed that implicit conversion and moved the functionality to |
Also, I considered embedding the Cache updating within the Let me know what you think and/or your results if you can test the code before I create 0.2.0-beta4. Thanks. |
Good, thank you!. Give me some time please |
Great!
Great. I'm curious why it used string-2-Symbol conversion instead of Symbol-2-string. I was not able to find the reason. I though about the order and tried
I thought about automatic updating as well. But string-2-Symbol implicit conversion implementation is too confusing. Especially for the direct instantiating (storing the whole Symbol in some 3rd party store and then operating with them seems pretty possible case). Do you use caching for something else except string-2-Symbol conversion? Actually I don't consider it as pretty useful helper. I use |
So short answers are:
btw, did you review the |
As for the runtime's choice of The Having an abstraction around the Also, it was never a goal or requirement to create a new release for every new symbol added by Binance (others have brought this up and I have that stated in the documentation too). The static assets and symbols were just for convenience/reference. However, looking at them again, it would be better if the static properties also referenced the updated cache instances.... I may have considered So, I'll look into:
|
If Cache is required I would rather leave it empty by default. And throw the exception using |
The static assets and symbols (I don't plan to remove those) should have something to reference and with these latest changes they will be referencing the statically initialized cache values. Unless constantly polled and updated (then why use a cache) some of the cached data will at some point will become outdated, and dealing with stale data is inevitable. It has been recommended to update the cache at program startup and at intervals. It may as well start out the best that it can be (so, I don't like the idea of leaving it empty with all null static definitions). If there is old data (at any time), then the user will get an exception eventually anyway when placing an order (unavoidable, so why duplicate with more exceptions). |
For issue #89. Change Asset.Cache and Symbol.Cache from IDictionary to IAssetCache and ISymbolCache respectively. Redirect static asset and symbol definitions to the cache to utilize run-time updates. Remove string-to-Asset implicit conversion. Update static assets and symbols.
Let me know what you think of these changes. I really hope this doesn't cause issues... like with issue #60. |
I have left a minor comment-suggestion in a commit. Feel free to approve it or ignore. The rest is great! |
For #89. Update static assets and symbols.
I've refactored to use |
Looks really great! |
0.2.0-beta4 released. |
Hi there,
I have faced one new interesting issue. I'm having a kind of local cache of active symbols. And I have a problem with Symbol to string comparing FOR NEW SYMBOLS. There are 3 new symbols for the
GNT
asset.Look at the screen:
So for the new symbol
GNTBTC
I have to call.ToString()
apart from the knownETHBTC
.I think it can be related to the string interning maybe. But I was not able to find the difference between
ETHBTC
andGNTBTC
.Also there is the problem with the
Symbol.Cache
related to this issue:There are 4 symbols related to
BCH
asset:And it looks like removing part of the syncing is not working during cache updating.
Binance/src/Binance/Symbol.cs
Line 839 in a2d4362
The text was updated successfully, but these errors were encountered: