Skip to content

Commit

Permalink
feat: prevRealm as a helper
Browse files Browse the repository at this point in the history
  • Loading branch information
r3v4s committed Jun 5, 2024
1 parent c5006b9 commit a1d9c90
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion gnovm/stdlibs/std/emit_event.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ func X_emit(m *gno.Machine, typ string, attrs []string) {
fnIdent := getPrevFunctionNameFromTarget(m, "Emit")
prevFunc := getPrevFunctionNameFromTarget(m, fnIdent) // get the previous function name of the function that called Emit

prevAddr, prevPath := X_getRealm(m, 1)
prevAddr, prevPath := prevRealm(m)
prev := prevStack{
PrevPkgPath: prevPath,
PrevPkgAddr: prevAddr,
Expand Down Expand Up @@ -78,3 +78,7 @@ type gnoEventAttribute struct {
Key string `json:"key"`
Value string `json:"value"`
}

func prevRealm(m *gno.Machine) (string, string) {
return X_getRealm(m, 1)
}

0 comments on commit a1d9c90

Please sign in to comment.