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 nep11 tracker #755

Closed
wants to merge 1 commit into from

Conversation

Ashuaidehao
Copy link
Contributor

Close #754

@@ -129,7 +129,8 @@ protected TransferRecord GetTransferRecord(UInt160 asset, Array stateItems)
return stateItems.Count switch
{
3 => new TransferRecord(asset, @from, to, null, amountItem.GetInteger()),
4 when (stateItems[3] is ByteString tokenId) => new TransferRecord(asset, @from, to, tokenId, amountItem.GetInteger()),
4 when stateItems[3] is ByteString tokenId => new TransferRecord(asset, @from, to, tokenId, amountItem.GetInteger()),
4 when stateItems[3] is Integer tokenId => new TransferRecord(asset, from, to, tokenId.GetSpan().ToArray(), amountItem.GetInteger()),
Copy link
Member

Choose a reason for hiding this comment

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

Why tokenId is an Integer?

Copy link
Contributor

Choose a reason for hiding this comment

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

Because it can be used in absence of neo-project/neo#1879?

Copy link
Member

Choose a reason for hiding this comment

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

Copy link

Choose a reason for hiding this comment

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

When the developer calls the contract, the tokenid is used as an Integer. The notified field is Integer。

event Example:

public static event Action<ByteString> OnTest;

public static void CallEvent(ByteString tokenId)
{
        OnTest(tokenId);
}

sb.EmitDynamicCall(contract, "callEvent", 1);
type of the field in event : Integer

sb.EmitDynamicCall(contract, "callEvent", ((BigInteger)1).ToByteArray());
type of the field in event: ByteString

Copy link
Contributor Author

Choose a reason for hiding this comment

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

When the developer calls the contract, the tokenid is used as an Integer. The notified field is Integer。

event Example:

public static event Action<ByteString> OnTest;

public static void CallEvent(ByteString tokenId)
{
        OnTest(tokenId);
}

sb.EmitDynamicCall(contract, "callEvent", 1); type of the field in event : Integer

sb.EmitDynamicCall(contract, "callEvent", ((BigInteger)1).ToByteArray()); type of the field in event: ByteString

For neo-project/neo#2810, we can ignore these "invalid" transactions and close this PR, right?

@Ashuaidehao Ashuaidehao closed this Sep 5, 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.

getnep11balances in TokensTrakcer doesn't return correct result compared with invoking tokensOf
4 participants