-
Notifications
You must be signed in to change notification settings - Fork 84
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
Add support for collection of oracles to chains endpoint #210
Conversation
Chain = apps.get_model("chains", "Chain") | ||
db_alias = schema_editor.connection.alias | ||
|
||
GasPrice.objects.using(db_alias).bulk_create( |
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.
Just curious, is this using
needed?
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 would say that it is not required reading this: https://docs.djangoproject.com/en/3.2/ref/models/querysets/#using
Since we are using just one DB. I think we can remove it 👍
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.
Removed it here 60342d3
) | ||
|
||
|
||
class GasPriceSerializer(serializers.Serializer): |
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.
Nice done
Closes #209
/api/v1/chains
: each chain is now allowed to have multiple gas price configurations (resulting in a collection instead of a single object offixed
andoracle
gas prices).GasPrice
for each chain is now ranked – a lower value means that it'd show up higher on the list (eg.:rank 1 > rank 100
)GasPrice
collection is allowed to be empty – this is not only to reduce complexity but also because the current relationship betweenGasPrice <> Chain
means that aChain
needs to exist first before assigning aGasPrice
to it.