fix: fix near-contract-standards event emission #374
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Pre-flight checklist
Motivation
fungible token, non fungible token contracts in near-contract-standards folder doesn't emit nep141 & nep171 event.
![image](https://private-user-images.githubusercontent.com/8237090/291276978-5807dcf5-6d3d-404b-9f66-df2c7da5a8e8.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkxNjcwNjksIm5iZiI6MTczOTE2Njc2OSwicGF0aCI6Ii84MjM3MDkwLzI5MTI3Njk3OC01ODA3ZGNmNS02ZDNkLTQwNGItOWY2Ni1kZjJjN2RhNWE4ZTgucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIxMCUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMTBUMDU1MjQ5WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9NDJmZmM0NTUxYjg0MzA5MzAzMDZmNTNkY2QzOTRlODdkZGE2YTlkZTJkMDU0MDFmY2I1ZjUxNjE3YjY2MjczMSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ._m8uIl3qaCJFUWPg5nv-O9o5FKdoYB5NORU-0Np_t60)
It seems that the code found in the near-contract-standards folder attempts to directly convert near-sdk-rs contracts to TypeScript. However, since it disregards Rust's serde tags and related annotations, there is an issue when emitting events through this contract code, as it doesn't properly track them as nep141 or nep171 events.
Test Plan
Related issues/PRs