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

Add missing fields to InnerTx in runtime #761

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

MetaB0y
Copy link

@MetaB0y MetaB0y commented Aug 10, 2022

It works the same way as others, I don't see any reason why it was not included previously; I assume it was forgotten?

Possible follow-ups:

  • Maybe it is not the only field omitted in such a way

Copy link
Member

@robert-zaremba robert-zaremba left a comment

Choose a reason for hiding this comment

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

utACK,
Yes, it was forgotten. We will check if other fields are missing.

@robert-zaremba robert-zaremba added the bug Something isn't working label Aug 10, 2022
@robert-zaremba
Copy link
Member

We will backport it to v5.x release

@MetaB0y
Copy link
Author

MetaB0y commented Aug 11, 2022

Thanks! If you are working on it, maybe it would make sense to provide stub support for TEAL 7 (it's in the same file, not sure if it may touch others)? Similarly to what Algobuilder has for TEAL 6, i.e. assetIDFields[7] = cloneDeep(assetIDFields[6]); etc.

See #759 for some context.

@MetaB0y
Copy link
Author

MetaB0y commented Aug 11, 2022

Hmm maybe it actually breaks something...

I found myself in a situation where interpreter.getAssetIDByReference fails on line if (appForeignAssets.includes(assetRef)) { because appForeginAssets (which equals this.runtime.ctx.tx.apas) is number while it should be number[].

Probably it is related to this change, but not 100% sure.

@MetaB0y
Copy link
Author

MetaB0y commented Aug 11, 2022

Yes, it is wrong, but I know how to do it properly, I will update this MR later.

Actually, it should be handled differently. It is an int array, and there are no handling for int arrays yet, only byte arrays and ints.

The good news is that it will probably handle other cases such as ForeignApps with no additional effort.

@MetaB0y
Copy link
Author

MetaB0y commented Aug 16, 2022

I implemented a proper fix and added it to tests (modified tests were failing before the fix).

I am going to add Accounts now.

@MetaB0y MetaB0y changed the title Add "Assets" field to assetIDFields in runtime Add missing fields to InnerTx in runtime Aug 16, 2022
@MetaB0y
Copy link
Author

MetaB0y commented Aug 16, 2022

Accounts are done. I don't see anything [important] missing now. I feel like it can be merged and backported

@robert-zaremba PTAL

@MetaB0y MetaB0y changed the base branch from master to develop August 23, 2022 12:05
@MetaB0y
Copy link
Author

MetaB0y commented Aug 24, 2022

@robert-zaremba friendly ping

@MetaB0y
Copy link
Author

MetaB0y commented Aug 31, 2022

Don't mean to be intrusive but could somebody take a look? It's blocking me and I have to change compiled js to make algobuilder work for my project which is quite inconvenient.

@PabloLION
Copy link
Contributor

Same problem here. I think I'll use your branch. TY.

@PabloLION
Copy link
Contributor

Hey @MetaB0y . I git-cloned your forked repo and switched to branch origin/runtime-assets-field and it didn't work.
It seems that you added all the fields for pyteal version 5 and 6 instead of version 7.
Maybe you've tested and haven't pushed some commits?

Do you want to fix it or should I make a new PR?

@MetaB0y
Copy link
Author

MetaB0y commented Sep 19, 2022

@PabloLION hi, I am not sure if it was changed recently but I don't think there was version 7 in algobuilder runtime at all. You can see it in the commit history.

And even if there is version 7, isn't it supposed to copy values from 6 and extend it when needed, like version 6 does now for 5 (numberTxnFields[6] = cloneDeep(numberTxnFields[5]);).

Regarding making a new PR - I don't mind, I just want this change to be merged, it doesn't matter how :)

@PabloLION
Copy link
Contributor

Yea sorry. I didn't follow up this thread. I realised that algo-builder supports up to pyteal 0.15 or 0.13, which supports up to teal v6.
So I stopped using functionalities from teal v7, and moved back to v6.

I tested your PR by adding building it and using it with my own test cases, after copying all v6 to v7 like you said, "copy values from 6 and extend it". And it worked for everything I needed. Although I didn't run the tests of this repo, I think this is a good PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants