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

Test-specific helpers in storage-plus #708

Closed
shanev opened this issue Apr 20, 2022 · 2 comments · Fixed by #709
Closed

Test-specific helpers in storage-plus #708

shanev opened this issue Apr 20, 2022 · 2 comments · Fixed by #709

Comments

@shanev
Copy link
Contributor

shanev commented Apr 20, 2022

mod.rs in storage-plus/src/indexes contains what appears to be test helpers:

pub fn index_string(data: &str) -> Vec<u8> {
    data.as_bytes().to_vec()
}

pub fn index_tuple(name: &str, age: u32) -> (Vec<u8>, u32) {
    (index_string(name), age)
}

pub fn index_triple(name: &str, age: u32, pk: Vec<u8>) -> (Vec<u8>, u32, Vec<u8>) {
    (index_string(name), age, pk)
}

pub fn index_string_tuple(data1: &str, data2: &str) -> (Vec<u8>, Vec<u8>) {
    (index_string(data1), index_string(data2))
}

Maybe the test-specific parameters like age could use better names? Or maybe this code doesn't belong here?

@maurolacy
Copy link
Contributor

Yes, these must be defined in the test section.

@shanev
Copy link
Contributor Author

shanev commented Apr 20, 2022

@maurolacy Something like #709?

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 a pull request may close this issue.

2 participants