Skip to content

Instantly share code, notes, and snippets.

@alexesDev
Last active August 24, 2022 11:14
Show Gist options
  • Save alexesDev/0958aa801064bc266956074b9ea5aff5 to your computer and use it in GitHub Desktop.
Save alexesDev/0958aa801064bc266956074b9ea5aff5 to your computer and use it in GitHub Desktop.
import (
// ...
gaia "github.com/Agoric/agoric-sdk/golang/cosmos/app"
"github.com/Agoric/agoric-sdk/golang/cosmos/x/swingset/types"
)
encodingConfig := gaia.MakeEncodingConfig()
decoder := encodingConfig.TxConfig.TxDecoder()
tx, err := decoder(item.Tx)
// ...
for _, msg := range tx.GetMsgs() {
m, ok := msg.(*types.MsgDeliverInbound)
if !ok {
continue
}
for _, submsg := range m.Messages {
// parse 69:55:deliver:ro+21:rp-104;["lookup",["uiConfig","VaultFactory"]]
sci := strings.Index(submsg, ";")
// ...
header := strings.Split(submsg[0:sci], ":")
...
select attributes->>'action' as type, count(*)
, min(tx_height) as first_height
, max(tx_height) as last_height
from indexer.agoric_events
where attributes->>'action' is not null
group by 1
order by 2 desc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment