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
fix: update names and oracles to v3 #1725
Conversation
docs/swagger_v3/names.spec.yaml
Outdated
@@ -1,4 +1,30 @@ | |||
schemas: | |||
NameTx: | |||
properties: |
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.
This doesn't appear to be nested inside NameTx. Also, what is a NameTx? is it claim, update, revoke?
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.
This is so i can resue the structure inside of the latter schemas
@@ -1,17 +1,73 @@ | |||
schemas: | |||
OracleTx: |
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.
Same here, what's an OracleTx? If it's an extends tx, shouldn't it be OracleExtendsTx ?
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'm using it only for the shape of the object, so it's not written everytime it's being used
docs/swagger_v3/oracles.spec.yaml
Outdated
type: array | ||
items: | ||
type: string | ||
tx: |
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.
tx
here should not be part of signatures
@@ -15,6 +15,15 @@ defmodule AeMdwWeb.OracleController do | |||
|
|||
@spec oracle(Conn.t(), map()) :: Conn.t() | |||
def oracle(%Conn{assigns: %{state: state, opts: opts}} = conn, %{"id" => id}) do | |||
with opts <- [{:v3, true} | opts], |
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.
Why use opts
as part of the with
statement instead of a regular variable binding?
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.
A habbit, on an older project we used to put the inside the with and if it's going to always match we used =
instead of <-
. I don't have a strong preference i can change it back
lib/ae_mdw_web/router.ex
Outdated
@@ -57,6 +57,8 @@ defmodule AeMdwWeb.Router do | |||
get "/micro-blocks/:hash/transactions", TxController, :micro_block_txs | |||
|
|||
get "/transactions", TxController, :txs | |||
get "/transactions/count", TxController, :count | |||
get "/transactions/count/:id", TxController, :count_id |
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.
This didn't change, we should leave it unchanged
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 moved them because /transactions/:hash
was above them and when i tried calling this it was trying to find a transaction with hash count
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.
This is already fixed here #1712, not yet merged, though
This addresses #1018