diff --git a/app/ship_processor.go b/app/ship_processor.go index 44c916e..92cc464 100644 --- a/app/ship_processor.go +++ b/app/ship_processor.go @@ -118,9 +118,9 @@ func (processor *ShipProcessor) processTraces(traces []*ship.TransactionTraceV0) channels := []transport.Channel{ transport.Action{}.Channel(), - transport.Action{Action: act.Name}.Channel(), + transport.Action{Name: act.Name}.Channel(), transport.Action{Contract: act.Contract}.Channel(), - transport.Action{Action: act.Name, Contract: act.Contract}.Channel(), + transport.Action{Name: act.Name, Contract: act.Contract}.Channel(), } for _, channel := range channels { diff --git a/transport/channel.go b/transport/channel.go index ca21e74..59e048a 100644 --- a/transport/channel.go +++ b/transport/channel.go @@ -38,8 +38,8 @@ var ( // Action Channel type Action struct { + Name string Contract string - Action string } func (a Action) Channel() Channel { @@ -49,8 +49,8 @@ func (a Action) Channel() Channel { ch.Append("contract", a.Contract) } - if len(a.Action) > 0 { - ch.Append("action", a.Action) + if len(a.Name) > 0 { + ch.Append("name", a.Name) } return ch diff --git a/transport/channel_test.go b/transport/channel_test.go index 676c3a6..9301c31 100644 --- a/transport/channel_test.go +++ b/transport/channel_test.go @@ -51,8 +51,8 @@ func TestActionChannel_String(t *testing.T) { }{ {"Empty", Action{}.Channel(), "actions"}, {"Contract", Action{Contract: "mycontract"}.Channel(), "actions/contract/mycontract"}, - {"Action", Action{Action: "myaction"}.Channel(), "actions/action/myaction"}, - {"ContractAndAction", Action{Contract: "mycontract", Action: "myaction"}.Channel(), "actions/contract/mycontract/action/myaction"}, + {"Action", Action{Name: "myaction"}.Channel(), "actions/name/myaction"}, + {"ContractAndName", Action{Contract: "mycontract", Name: "myaction"}.Channel(), "actions/contract/mycontract/name/myaction"}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) {