Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[tm2/gnovm] Identify each msg's event #2031

Closed
r3v4s opened this issue May 3, 2024 · 1 comment
Closed

[tm2/gnovm] Identify each msg's event #2031

r3v4s opened this issue May 3, 2024 · 1 comment

Comments

@r3v4s
Copy link
Contributor

r3v4s commented May 3, 2024

Description

While fixing #2028 in #2030, I found out that all of events in single transactions are just being append into single object.

For example if we execute multi-msg tx

await adena.DoContract({
    messages: [{
        "type": "/vm.m_call",
        "value": {
          "caller": "g1jg8mtutu9khhfwc4nxmuhcpftf0pajdhfvsqf5",
          "send": "",
          "pkg_path": "gno.land/r/demo/event",
          "func": "Hello",
          "args": []
        }
      },{
        "type": "/vm.m_call",
        "value": {
          "caller": "g1jg8mtutu9khhfwc4nxmuhcpftf0pajdhfvsqf5",
          "send": "",
          "pkg_path": "gno.land/r/demo/event",
          "func": "Other",
          "args": []
        }
      }],
    gasFee: 1, 
    gasWanted: 2000000
  });

Event gets like this

"Events": [
    {
      "@type": "/tm.gnoEvent",
      "pkg_path": "gno.land/r/demo/event2",
      "type": "t",
      "func": "inner",
      "attrs": [
        {
          "key": "k",
          "value": "v"
        }
      ]
    },
    {
      "@type": "/tm.gnoEvent",
      "pkg_path": "gno.land/r/demo/event2",
      "type": "t",
      "func": "Hello",
      "attrs": [
        {
          "key": "k",
          "value": "v"
        }
      ]
    },
    {
      "@type": "/tm.gnoEvent",
      "pkg_path": "gno.land/r/demo/event",
      "type": "t",
      "func": "inner",
      "attrs": [
        {
          "key": "k",
          "value": "v"
        }
      ]
    },
    {
      "@type": "/tm.gnoEvent",
      "pkg_path": "gno.land/r/demo/event",
      "type": "t",
      "func": "Hello",
      "attrs": [
        {
          "key": "k",
          "value": "v"
        }
      ]
    },
    {
      "@type": "/tm.gnoEvent",
      "pkg_path": "gno.land/r/demo/event",
      "type": "other",
      "func": "Other",
      "attrs": [
        {
          "key": "k",
          "value": "v"
        }
      ]
    }
  ],

With current event struct, as you can see we don't know which call made which event(s).
IMHO, we need identify (or divide) each function's event

  1. first group of event
{
  "@type": "/tm.gnoEvent",
  "pkg_path": "gno.land/r/demo/event2",
  "type": "t",
  "func": "inner",
  "attrs": [
    {
      "key": "k",
      "value": "v"
    }
  ]
},
{
  "@type": "/tm.gnoEvent",
  "pkg_path": "gno.land/r/demo/event2",
  "type": "t",
  "func": "Hello",
  "attrs": [
    {
      "key": "k",
      "value": "v"
    }
  ]
},
{
  "@type": "/tm.gnoEvent",
  "pkg_path": "gno.land/r/demo/event",
  "type": "t",
  "func": "inner",
  "attrs": [
    {
      "key": "k",
      "value": "v"
    }
  ]
},
{
  "@type": "/tm.gnoEvent",
  "pkg_path": "gno.land/r/demo/event",
  "type": "t",
  "func": "Hello",
  "attrs": [
    {
      "key": "k",
      "value": "v"
    }
  ]
},
  1. second group of event
{
  "@type": "/tm.gnoEvent",
  "pkg_path": "gno.land/r/demo/event",
  "type": "other",
  "func": "Other",
  "attrs": [
    {
      "key": "k",
      "value": "v"
    }
  ]
}
@r3v4s r3v4s self-assigned this May 3, 2024
@leohhhn leohhhn changed the title Identify each msg's event [tm2/gnovm] Identify each msg's event May 6, 2024
@r3v4s r3v4s assigned notJoon and unassigned notJoon May 8, 2024
@dongwon8247 dongwon8247 moved this to In Progress in 🤝🏻 Partner: Onbloc May 9, 2024
@Kouteki Kouteki moved this from Triage to In Progress in 🧙‍♂️gno.land core team May 10, 2024
@Kouteki Kouteki added this to the 🏗4️⃣ test4.gno.land milestone May 10, 2024
@zivkovicmilos
Copy link
Member

Closed as part of #2061

@zivkovicmilos zivkovicmilos closed this as not planned Won't fix, can't repro, duplicate, stale Jun 11, 2024
@github-project-automation github-project-automation bot moved this from In Progress to Done in 🧙‍♂️gno.land core team Jun 11, 2024
@github-project-automation github-project-automation bot moved this from In Progress to Done in 🤝🏻 Partner: Onbloc Jun 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

4 participants