#Storage Symbol Ending with single digit

7 messages · Page 1 of 1 (latest)

agile canopy
#

Create the following function on a contract :

pub fn test_storage(env: Env, test_value: Symbol) {
env.storage().persistent().set(&symbol_short!("key"), &test_value);
}

When this is invoked with a test_value ending in a single digit then an error is thrown.
E.G : test_value = "test 0" would result in error but "test 00" works alright.

Why is this happening?
Is this expected?

novel magnet
#

The problem is the space

#

Symbol doc says:

Valid characters are a-zA-Z0-9_ and maximum length is 32 characters.

agile canopy
#

Why does it work with "test 00" then?

novel magnet
#

they both fail when I try

astral star
#

@agile canopy What version of the Rust SDK are you using?

agile canopy
#

Sorry guys. This seems to have been a problem between the chair and the screen. I.e. my mistake 😂