Unable to use SmartTables #392
Answered
by
gregnazario
0xblockbard
asked this question in
Questions
-
Hello all, have been unable to use smart tables, even on very simple use cases, does anyone know what's wrong? Have been following the docs here: https://aptos.dev/en/build/smart-contracts/smart-table Sample code: let removed_value = SmartTable::remove(&mut table, 1); |
Beta Was this translation helpful? Give feedback.
Answered by
gregnazario
Aug 31, 2024
Replies: 1 comment 1 reply
-
All functions have to use the module name, instead of the type name. Try module 0x42::example {
use aptos_std::smart_table::{self, SmartTable};
fun do_something(){
let key:u8 = 1;
let table = smart_table::new<u8, u8>();
let removed_value = smart_table::remove(&mut table, key);
}
} Looks like the docs are wrong and we'll fix it |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
0xaptosj
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
All functions have to use the module name, instead of the type name. Try
Looks like the docs are wrong and we'll fix it