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

Refactor await native #917

Closed
wants to merge 3 commits into from
Closed

Refactor await native #917

wants to merge 3 commits into from

Conversation

shargon
Copy link
Member

@shargon shargon commented Feb 20, 2024

I have some problems with the netstandard change and the current package, trying to find how to solve it

Comment on lines +154 to +174
/*
if (result is not ContractTask task)
throw new Exception($"Error casting {native.Name}.{method.Name} to ContractTask");

task.GetAwaiter().GetResult();
*/

if (result is null)
throw new Exception($"{native.Name}.{method.Name} result can't be null");

method = result.GetType().GetMethod("GetAwaiter", BindingFlags.Public | BindingFlags.Instance)!;
result = method?.Invoke(result, Array.Empty<object>());

if (result is null)
throw new Exception($"{native.Name}.{method?.Name}.GetAwaiter() result can't be null");

method = result.GetType().GetMethod("GetResult", BindingFlags.Public | BindingFlags.Instance)!;
result = method?.Invoke(result, Array.Empty<object>());

if (result is not null)
throw new Exception($"{native.Name}.{method?.Name}.GetAwaiter().GetResult() can't be not null");
Copy link
Member Author

Choose a reason for hiding this comment

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

@Jim8y I know that is not a fix, but while we found the solution I think this will allow me to continue working

@shargon shargon marked this pull request as ready for review February 20, 2024 09:10
@shargon
Copy link
Member Author

shargon commented Feb 21, 2024

I think it won't be required after #926 and #927

@shargon
Copy link
Member Author

shargon commented Feb 21, 2024

Not required, package was fixed

@shargon shargon closed this Feb 21, 2024
@shargon shargon deleted the core-fix-ct branch February 21, 2024 09:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant