1
0
Fork 0
mirror of https://github.com/eosswedenorg/thalos synced 2026-06-17 04:30:03 +02:00

transport/channel.go: rename Action.Action to Action.Name

This commit is contained in:
Henrik Hautakoski 2023-03-07 18:53:52 +01:00
parent 7637b6e16b
commit 347de718af
3 changed files with 7 additions and 7 deletions

View file

@ -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 {

View file

@ -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

View file

@ -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) {