-
Notifications
You must be signed in to change notification settings - Fork 100
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
fix nep11 tracker #755
Conversation
@@ -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()), |
There was a problem hiding this comment.
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
?
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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?
Close #754