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

fix: update names and oracles to v3 #1725

Merged
merged 2 commits into from Apr 15, 2024
Merged

fix: update names and oracles to v3 #1725

merged 2 commits into from Apr 15, 2024

Conversation

yaboiishere
Copy link
Contributor

This addresses #1018

@yaboiishere yaboiishere self-assigned this Apr 5, 2024
@yaboiishere yaboiishere marked this pull request as ready for review April 5, 2024 13:45
@@ -1,4 +1,30 @@
schemas:
NameTx:
properties:
Copy link
Contributor

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?

Copy link
Contributor Author

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:
Copy link
Contributor

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 ?

Copy link
Contributor Author

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

type: array
items:
type: string
tx:
Copy link
Contributor

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],
Copy link
Contributor

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?

Copy link
Contributor Author

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

@@ -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
Copy link
Contributor

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

Copy link
Contributor Author

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

Copy link
Contributor

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

@sborrazas sborrazas merged commit 8f9af21 into master Apr 15, 2024
7 checks passed
@sborrazas sborrazas deleted the fix-v3-names-oracles branch April 15, 2024 10:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants