fix: Upgrade status-go to the most recent version of release branch which contains memory fix

Fix #4990
This commit is contained in:
Michal Iskierko
2024-05-13 12:21:03 +02:00
committed by Michał Iskierko
parent 03d490156a
commit 66cf3d21b9
230 changed files with 30930 additions and 14243 deletions

View File

@@ -1,6 +1,7 @@
package walletevent
import (
"encoding/json"
"math/big"
"strings"
@@ -31,3 +32,16 @@ type Event struct {
// For Internal events only, not serialized
EventParams interface{}
}
func GetPayload[T any](e Event) (*T, error) {
var payload T
err := json.Unmarshal([]byte(e.Message), &payload)
if err != nil {
return nil, err
}
return &payload, nil
}
func ExtractPayload[T any](e Event, payload *T) error {
return json.Unmarshal([]byte(e.Message), payload)
}