BlockPo / BlockPo-to-Tradelayer

Incubation Repo for the TradeLayer protocol, 0.2.0
http://www.tradelayer.org
Other
8 stars 8 forks source link

Return parameters "contractName" to "contractid" #295

Closed patrickdugan closed 4 years ago

patrickdugan commented 4 years ago

It seems very tricky to have to keep a list of strings, which can be duplicates, in order to refer to contracts, when one can pull listOracles and listNatives and get the propertyids of all contracts, ids which cannot be duplicates.

Galuf1 commented 4 years ago

They cannot be duplicates. Also there is a couple reasons why you'd want the contract names, first it's already established in naming conventions how to name a contract, if we have duplicate names and search for propertyid at some point we'll have hundreds of the same contract, having to do a lot of extra code in bots to guess what's the correct contract. Also there is the problem with synchrony, if you do that you'll have to do asynchronous calls to get the identifier before do trades in a bot or using the api. With name conventions you know for sure what are you looking for, if you want the july native 2020 monthy BTC/USD you know that it's going to be called before without pinging the code.

Still your call, but i think that it's more clear this way and the naming convention is already established and it works.

patrickdugan commented 4 years ago

Can it be both? If type==string then contractName, if type==double then id? Make them flexible that way.

On Thu, Jun 25, 2020 at 12:06 PM Galuf1 notifications@github.com wrote:

They cannot be duplicates. Also there is a couple reasons why you'd want the contract names, first it's already established in naming conventions how to name a contract, if we have duplicate names and search for propertyid at some point we'll have hundreds of the same contract, having to do a lot of extra code in bots to guess what's the correct contract. Also there is the problem with synchrony, if you do that you'll have to do asynchronous calls to get the identifier before do trades in a bot or using the api. With name conventions you know for sure what are you looking for, if you want the july native 2020 monthy BTC/USD you know that it's going to be called before without pinging the code.

Still your call, but i think that it's more clear this way and the naming convention is already established and it works.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/BlockPo/BlockPo-to-Tradelayer/issues/295#issuecomment-649657852, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAS2CBIGGCI5YQQLXTLFLODRYNYWNANCNFSM4OHPCZOA .

Galuf1 commented 4 years ago

i don't know if we can, can we do this @santos177 ?