From 79e7443176964bb9676142a4f23531a9cdab7fe1 Mon Sep 17 00:00:00 2001 From: teateatea Date: Fri, 12 Jan 2024 17:32:39 +0300 Subject: [PATCH] feat: UpdateUser --- contract/passtorage.go | 10 ++++++++++ 1 file changed, 10 insertions(+) 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) + } +}