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 ut for property #1233

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Open

add ut for property #1233

wants to merge 10 commits into from

Conversation

Jim8y
Copy link
Contributor

@Jim8y Jim8y commented Nov 8, 2024

this pr adds ut to property to demonstrate that property actually does not work correctly.

@Hecate2
Copy link
Contributor

Hecate2 commented Nov 8, 2024

My fault, not applying NeedInstanceConstructor everywhere.
Jim8y#3

fix non-static field get and set
shargon
shargon previously approved these changes Nov 8, 2024
@shargon shargon self-requested a review November 8, 2024 07:41
@shargon
Copy link
Member

shargon commented Nov 8, 2024

Ut fault

@Hecate2
Copy link
Contributor

Hecate2 commented Nov 8, 2024

Ut fault

Because of calling ++ on null

@Jim8y
Copy link
Contributor Author

Jim8y commented Nov 8, 2024

Ut fault

I am debugging this, but without a proper tool, it is very hard to locate where the opcode is being processed in the compiler, very hard to debug.

@Hecate2
Copy link
Contributor

Hecate2 commented Nov 11, 2024

Should be ready for merge

.ToArray();

// Process each field using its symbol
ContractFields.ForEach(f => AddStaticField(f.Field));
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
ContractFields.ForEach(f => AddStaticField(f.Field));
foreach ((IFieldSymbol f, _) in ContractFields)
AddStaticField(f);

Copy link
Contributor

@Hecate2 Hecate2 Nov 11, 2024

Choose a reason for hiding this comment

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

array.ForEach is using Akka.Util.Internal, and is harder to debug

@@ -29,6 +29,7 @@
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;
using Akka.Util.Internal;
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
using Akka.Util.Internal;

{
if(_context.ContractFields.Any(f =>
SymbolEqualityComparer.Default.Equals(f.Field, field)) &&
(field.Type.GetStackItemType() == StackItemType.Integer || field.Type.GetStackItemType() == StackItemType.Integer))
Copy link
Contributor

Choose a reason for hiding this comment

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

f.Field.Type😰?

@Hecate2
Copy link
Contributor

Hecate2 commented Nov 11, 2024

If we apply the methodology in d552e2e , we try to convert all non-static fields (in a class that directly inherit SmartContract) to static. This can bring trouble when we read the non-static fields, and we will need to change many codes related to IFieldSymbol and IdentifierNameSyntax.

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.

3 participants