feat: UpdateUser

This commit is contained in:
teateatea 2024-01-12 17:32:39 +03:00
parent c539ce303a
commit 79e7443176

View file

@ -30,3 +30,13 @@ func DeleteUser(login string) {
ctx := storage.GetContext() ctx := storage.GetContext()
storage.Delete(ctx, login) storage.Delete(ctx, login)
} }
func UpdateUser(login string, password interop.Hash256) {
ctx := storage.GetContext()
storedValue := storage.Get(ctx, login).(interop.Hash256)
if storedValue == nil {
panic("This user does not exist")
} else {
storage.Put(ctx, login, password)
}
}