diff --git a/contract/passtorage.go b/contract/passtorage.go index 13f921d..e17c295 100644 --- a/contract/passtorage.go +++ b/contract/passtorage.go @@ -30,3 +30,13 @@ func DeleteUser(login string) { ctx := storage.GetContext() 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) + } +}