Skip to content

Conversation

@barnjamin
Copy link
Contributor

@barnjamin barnjamin commented May 16, 2022

Adding reference types to ABI module so we can easily use them in Router.

Targeting abi-router since I'm using it for testing so branched off abi-router

Needs tests but want to make sure this is a reasonable way to attempt this

@ahangsu
Copy link
Contributor

ahangsu commented May 16, 2022

I guess this should comes to feature/abi first, not abi-router, since router work is kind of parallel to reference type?

nvm... just saw the description

Copy link
Contributor

@ahangsu ahangsu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

took a quick pass and have some negligible comments, and the only unsettled question is set, I think.

@michaeldiamant michaeldiamant linked an issue May 17, 2022 that may be closed by this pull request
@algoidurovic algoidurovic self-requested a review May 18, 2022 17:44
Copy link
Contributor

@algoidurovic algoidurovic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good overall, just a few points I'd like you to address.

barnjamin and others added 2 commits May 19, 2022 15:42
Co-authored-by: algoidurovic <91566643+algoidurovic@users.noreply.github.com>
@ahangsu
Copy link
Contributor

ahangsu commented May 19, 2022

one thing to notice, Zeph merged in #322 to feature/abi today, you might want to update too...

@tzaffi
Copy link
Contributor

tzaffi commented May 19, 2022

one thing to notice, Zeph merged in #322 to feature/abi today, you might want to update too...

RIght. In particular, it introduced a new member annotation_type that should also be implemented in this PR.

@tzaffi
Copy link
Contributor

tzaffi commented May 19, 2022

Also, not to hold up the PR, but if simple test cases could be added here, that would be great. I believe that the companion abi_roundtrip.py class should be able to handle these new types (because their TypeSpecs subclass the UintTypeSpec) but I'm not 100% sure.

@barnjamin
Copy link
Contributor Author

I think to actually fix tests we need to have a change to the py sdk to support reference types https://github.com/algorand/py-algorand-sdk/blob/master/algosdk/abi/base_type.py#L59

@tzaffi
Copy link
Contributor

tzaffi commented May 23, 2022

I think to actually fix tests we need to have a change to the py sdk to support reference types https://github.com/algorand/py-algorand-sdk/blob/master/algosdk/abi/base_type.py#L59

That's a good finding. Interestingly, we do have a related test case for handling reference types in method signatures, so I am a bit puzzled by how we pass that test without explicitly handling reference types in base_type.py#L59.

@algochoi - it's been a while since you worked on this but maybe you have an insight?

@ahangsu
Copy link
Contributor

ahangsu commented May 23, 2022

^ we should correspondingly check all other SDK's about unified behavior of type from string function...

@tzaffi
Copy link
Contributor

tzaffi commented May 23, 2022

@jasonpaulos has shed some light in a separate thread. This is related to a relatively recent change to arc-4

@algochoi
Copy link
Contributor

I think to actually fix tests we need to have a change to the py sdk to support reference types https://github.com/algorand/py-algorand-sdk/blob/master/algosdk/abi/base_type.py#L59

That's a good finding. Interestingly, we do have a related test case for handling reference types in method signatures, so I am a bit puzzled by how we pass that test without explicitly handling reference types in base_type.py#L59.

@algochoi - it's been a while since you worked on this but maybe you have an insight?

The transaction references are handled in the atomic_transaction_composer.py and is only used when the method signature is parsed. +1 to this was a relatively recent thing we added.

@barnjamin
Copy link
Contributor Author

Completely cheating right now by just skipping round trip tests for the Reference Types. Should we wait to merge this until those are available in the SDK?

@tzaffi
Copy link
Contributor

tzaffi commented May 24, 2022

Is there a reason that this is basing off of abi-router instead of feature/abi ?

@ahangsu
Copy link
Contributor

ahangsu commented May 24, 2022

Is there a reason that this is basing off of abi-router instead of feature/abi ?

I think Ben is testing his code against my router implementation, this PR going into feature/abi makes more sense to me.

@ahangsu ahangsu force-pushed the abi-router branch 2 times, most recently from 39bd2b7 to 4e8efe2 Compare May 24, 2022 19:09
@barnjamin barnjamin force-pushed the foreign-args branch 3 times, most recently from d046da9 to e1aba28 Compare May 25, 2022 11:35
@barnjamin
Copy link
Contributor Author

superseded by #361

@barnjamin barnjamin closed this May 25, 2022
@barnjamin barnjamin deleted the foreign-args branch May 25, 2022 11:48
@barnjamin barnjamin mentioned this pull request May 25, 2022
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.

5 participants