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

feat: add supporting for querying sponsor message #73

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ go 1.22

toolchain go1.22.5

replace github.com/gnolang/gno => github.com/linhpn99/gno v1.0.0

require (
github.com/99designs/gqlgen v0.17.49
github.com/cockroachdb/pebble v1.1.1
Expand All @@ -15,11 +17,13 @@ require (
github.com/olahol/melody v1.2.1
github.com/peterbourgon/ff/v3 v3.4.0
github.com/pkg/errors v0.9.1
github.com/rs/cors v1.11.0
github.com/stretchr/testify v1.9.0
github.com/vektah/gqlparser/v2 v2.5.16
go.uber.org/multierr v1.11.0
go.uber.org/zap v1.27.0
golang.org/x/sync v0.7.0

)

require (
Expand Down
6 changes: 4 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,6 @@ github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMo
github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ=
github.com/getsentry/sentry-go v0.27.0 h1:Pv98CIbtB3LkMWmXi4Joa5OOcwbmnX88sF5qbK3r3Ps=
github.com/getsentry/sentry-go v0.27.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w1gwTf25trprY=
github.com/gnolang/gno v0.1.1 h1:t41S0SWIUa3syI7XpRAuCneCgRc8gOJ2g8DkUedF72U=
github.com/gnolang/gno v0.1.1/go.mod h1:BTaBNeaoY/W95NN6QA4RCoQ6Z7mi8M+Zb1I1wMWGg2w=
github.com/gnolang/overflow v0.0.0-20170615021017-4d914c927216 h1:GKvsK3oLWG9B1GL7WP/VqwM6C92j5tIvB844oggL9Lk=
github.com/gnolang/overflow v0.0.0-20170615021017-4d914c927216/go.mod h1:xJhtEL7ahjM1WJipt89gel8tHzfIl/LyMY+lCYh38d8=
github.com/go-chi/chi/v5 v5.1.0 h1:acVI1TYaD+hhedDJ3r54HyA6sExp3HfXq7QWEEY/xMw=
Expand Down Expand Up @@ -143,6 +141,8 @@ github.com/lib/pq v1.10.7 h1:p7ZhMD+KsSRozJr34udlUrhboJwWAgCg34+/ZZNvZZw=
github.com/lib/pq v1.10.7/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o=
github.com/libp2p/go-buffer-pool v0.1.0 h1:oK4mSFcQz7cTQIfqbe4MIj9gLW+mnanjyFtc6cdF0Y8=
github.com/libp2p/go-buffer-pool v0.1.0/go.mod h1:N+vh8gMqimBzdKkSMVuydVDq+UV5QTWy5HSiZacSbPg=
github.com/linhpn99/gno v1.0.0 h1:2f+fX2c03jbD82mQJjbPk0oRLcyIKJPNLPFFoBpPX7A=
github.com/linhpn99/gno v1.0.0/go.mod h1:BTaBNeaoY/W95NN6QA4RCoQ6Z7mi8M+Zb1I1wMWGg2w=
github.com/madz-lab/insertion-queue v0.0.0-20230520191346-295d3348f63a h1:KxTVE11SAJzp+PnqaCw0Rzb/of6mQexpTIyZwM/JTJU=
github.com/madz-lab/insertion-queue v0.0.0-20230520191346-295d3348f63a/go.mod h1:kWWMMyVnsC79rIkENl7FQUU2EQql12s8ETwjsDBiMtA=
github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY=
Expand Down Expand Up @@ -180,6 +180,8 @@ github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3c
github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs=
github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8=
github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4=
github.com/rs/cors v1.11.0 h1:0B9GE/r9Bc2UxRMMtymBkHTenPkHDv0CW4Y98GBY+po=
github.com/rs/cors v1.11.0/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU=
github.com/rs/xid v1.5.0 h1:mKX4bl4iPYJtEIxp6CYiUuLQ/8DYMoz0PUdtGgMFRVc=
github.com/rs/xid v1.5.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg=
github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk=
Expand Down
146 changes: 145 additions & 1 deletion serve/graph/generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

30 changes: 27 additions & 3 deletions serve/graph/model/models_gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 22 additions & 0 deletions serve/graph/model/transaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -231,8 +231,15 @@
TypeURL: MessageTypeRun.String(),
Value: makeVMMsgRun(message),
}
case MessageTypeNoOp.String():
contentMessage = &TransactionMessage{
Route: MessageRouteVM.String(),
TypeURL: MessageTypeNoOp.String(),
Value: makeVMMsgNoop(message),
}
}

}

Check failure on line 242 in serve/graph/model/transaction.go

View workflow job for this annotation

GitHub Actions / Go Linter / lint

unnecessary trailing newline (whitespace)

Check failure on line 242 in serve/graph/model/transaction.go

View workflow job for this annotation

GitHub Actions / Go Linter / lint

block should not end with a whitespace (or comment) (wsl)

if contentMessage == nil {
contentMessage = &TransactionMessage{
Expand Down Expand Up @@ -261,6 +268,10 @@
return tm.Value.(MsgRun)
}

func (tm *TransactionMessage) VMMsgNoop() MsgNoop {
return tm.Value.(MsgNoop)
}

func makeEvent(abciEvent abci.Event) (Event, error) {
data, err := json.Marshal(abciEvent)
if err != nil {
Expand Down Expand Up @@ -356,6 +367,17 @@
}
}

func makeVMMsgNoop(value std.Msg) MsgNoop {
decodedMessage, err := cast[vm.MsgNoop](value)
if err != nil {
return MsgNoop{}
}

return MsgNoop{
Caller: decodedMessage.Caller.String(),
}
}

func makeUnexpectedMessage(value std.Msg) UnexpectedMessage {
raw, err := json.Marshal(value)
if err != nil {
Expand Down
Loading
Loading