Closed stormeye2000 closed 1 year ago
Hi @stormeye2000 .
the problem seems to be you're including the prefix byte 01
that indicates the key is a hash. So HashKey
constructor receives: "hash-016ff3127d815871618b6f639cf4a4a2df4edeacb8a0df662822707a5e570c9d32"
. Which is not a correct hash. Actually, the constructor should throw an error. Instead, it's ignoring the last byte. I'll fix that.
You can create the key
instance like this:
var key = GlobalStateKey.FromBytes(Hex.Decode("016ff3127d815871618b6f639cf4a4a2df4edeacb8a0df662822707a5e570c9d32"));
var clvalue =CLValue.Key(key);
var strkey = clvalue .ToString();
or
var key = new HashKey(("hash-6ff3127d815871618b6f639cf4a4a2df4edeacb8a0df662822707a5e570c9d32"));
var clvalue =CLValue.Key(key);
var strkey = clvalue .ToString();
Hope this helps.
Thanks a lot @davidatwhiletrue
This now works, the tests pass.
Issue closed
Hi
A CLType of Key is added as a NamedArg to RunTimeArgs in a Session Deploy Before the Deploy the Key has the correct bytes After the Deploy the NamedArg with the Key value returns the bytes with the last two characters missing:
Expected string length 79 but was 77. Strings differ at index 77. Expected: "...3127D815871618B6F639CF4A4A2DF4EDEACB8A0DF662822707A5E570C9D32" But was: "...3127D815871618B6F639CF4A4A2DF4EDEACB8A0DF662822707A5E570C9D" -------------------------------------------------------------------------^
This is being tested here:
I'm creating the Key here:
Happy to accept I'm doing it wrong!
Many thanks
Telegram: @cnorburn