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

TODO's addressing #4972

Merged
merged 5 commits into from
Jul 17, 2024
Merged

TODO's addressing #4972

merged 5 commits into from
Jul 17, 2024

Conversation

csgui
Copy link

@csgui csgui commented Jul 17, 2024

No description provided.

@csgui csgui requested a review from a team as a code owner July 17, 2024 16:22
@csgui csgui requested a review from obycode July 17, 2024 16:23
@@ -1530,7 +1518,7 @@ fn pass_argument_to_wasm(
Ok((buffer, offset, adjusted_in_mem_offset))
}
Value::Sequence(SequenceData::String(CharType::UTF8(_s))) => {
todo!("Value type not yet implemented: {:?}", value)
Err(Error::Wasm(WasmError::UnhandledType))
Copy link
Contributor

Choose a reason for hiding this comment

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

This one should not be an error. This just needs to get implemented. Please leave the todo! and open an issue for it.

Copy link
Author

Choose a reason for hiding this comment

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

Ok. Reverted.

Comment on lines 1557 to 1559
Value::Principal(_p) => Err(Error::Wasm(WasmError::UnhandledType)),
Value::CallableContract(_c) => Err(Error::Wasm(WasmError::UnhandledType)),
Value::Tuple(_t) => Err(Error::Wasm(WasmError::UnhandledType)),
Copy link
Contributor

Choose a reason for hiding this comment

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

Same for these, but don't worry about opening an issue for these, @Acaccia is already working on them.

Copy link
Author

Choose a reason for hiding this comment

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

Ok. Reverted.

@@ -144,6 +144,7 @@ pub enum WasmError {
ExpectedReturnValue,
InvalidIndicator(i32),
Runtime(wasmtime::Error),
UnhandledType,
Copy link
Contributor

Choose a reason for hiding this comment

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

This error should instead be InvalidType. We don't want an error for a type that is not handled yet, just an error for a type that should not be allowed where it was found.

Copy link
Contributor

Choose a reason for hiding this comment

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

Or you could use the existing InvalidNoTypeInValue and add InvalidListUnionTypeInValue.

Copy link
Author

Choose a reason for hiding this comment

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

Done. Added InvalidListUnionTypeInValue.

@@ -182,6 +183,7 @@ impl fmt::Display for WasmError {
write!(f, "Invalid response/optional indicator: {indicator}")
}
WasmError::Runtime(e) => write!(f, "Runtime error: {e}"),
WasmError::UnhandledType => write!(f, "Type not handled"),
Copy link
Contributor

Choose a reason for hiding this comment

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

Update this accordingly.

Copy link
Author

Choose a reason for hiding this comment

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

Done

@csgui
Copy link
Author

csgui commented Jul 17, 2024

@obycode Made changes to address the errors. Now I understand your intent. Thanks!

@csgui csgui requested a review from obycode July 17, 2024 17:25
Copy link
Contributor

@obycode obycode left a comment

Choose a reason for hiding this comment

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

Thanks Chris. Looks good. I think you just need to run the formatter.

cargo +nightly fmt-stacks

@csgui csgui requested a review from obycode July 17, 2024 17:35
Copy link
Contributor

@obycode obycode left a comment

Choose a reason for hiding this comment

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

👍

@csgui csgui merged commit 6eb4a23 into feat/clarity-wasm-develop Jul 17, 2024
1 check passed
@csgui csgui deleted the wasm-todo-addressing branch July 17, 2024 19:31
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.

None yet

2 participants