Skip to content
This repository was archived by the owner on Oct 28, 2025. It is now read-only.

Remove unused host functions (Fixes #231)#241

Closed
sappenin wants to merge 11 commits intomainfrom
df/fixes-231-remove-unused-host-functions
Closed

Remove unused host functions (Fixes #231)#241
sappenin wants to merge 11 commits intomainfrom
df/fixes-231-remove-unused-host-functions

Conversation

@sappenin
Copy link
Copy Markdown
Collaborator

High Level Overview of Change

This PR removes the no-longer-used/needed host_bindings_loose.rs and host_bindings_loose_for_testing.rs. During implementation of this issue, it was discovered that the projects/e2e_tests/codecov_tests were not being executed as part of the scripts/e2e-tests.sh build step (because the codecov_tests lacked a fixtures folder, prompting that test to be ignored). This PR also restores that test and updates assertions based on real fixture data.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Refactor (non-breaking change that only restructures code)
  • Tests (You added tests for code that already exists, or your new feature included in this PR)

@sappenin sappenin self-assigned this Sep 30, 2025
// Step #2: Test set_data edge cases
// ########################################
check_result(
unsafe { host_bindings_loose::get_parent_ledger_hash(-1, 4) },
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Passing a negative number to get_parent_ledger_hash is not impossible per Rust type-checking.

"get_parent_ledger_hash_len_too_long",
)
});
// NOTE: This test is commented out because the WASM runtime catches the out of bounds
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

LMK and I'll simply remove these commented out tests. Wanted to leave them in for now to make sure we evaluate this change-set properly.

error_codes::POINTER_OUT_OF_BOUNDS,
"get_tx_nested_array_len_ptr_oob",
);
// NOTE: These tests are commented out because the WASM runtime catches the out of bounds
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

LMK and I'll simply remove these commented out tests. Wanted to leave them in for now to make sure we evaluate this change-set properly.

check_result(
unsafe { host::account_keylet(locator.as_ptr(), locator.len(), ptr, len) },
error_codes::INVALID_PARAMS,
error_codes::BUFFER_TOO_SMALL,
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Not sure if these tests are potentially invalid now. @mvadari to comment.

@sappenin sappenin added bug Something isn't working enhancement New feature or request labels Sep 30, 2025
@sappenin
Copy link
Copy Markdown
Collaborator Author

Closing this PR -- it doesn't seem easy (or necessary) to have codecov tests running as part of the Craft build.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

bug Something isn't working enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants