mirror of
https://github.com/eosswedenorg/thalos
synced 2026-07-04 12:03:41 +02:00
transport/channel.go: rename Action.Action to Action.Name
This commit is contained in:
parent
7637b6e16b
commit
347de718af
3 changed files with 7 additions and 7 deletions
|
|
@ -118,9 +118,9 @@ func (processor *ShipProcessor) processTraces(traces []*ship.TransactionTraceV0)
|
||||||
|
|
||||||
channels := []transport.Channel{
|
channels := []transport.Channel{
|
||||||
transport.Action{}.Channel(),
|
transport.Action{}.Channel(),
|
||||||
transport.Action{Action: act.Name}.Channel(),
|
transport.Action{Name: act.Name}.Channel(),
|
||||||
transport.Action{Contract: act.Contract}.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 {
|
for _, channel := range channels {
|
||||||
|
|
|
||||||
|
|
@ -38,8 +38,8 @@ var (
|
||||||
|
|
||||||
// Action Channel
|
// Action Channel
|
||||||
type Action struct {
|
type Action struct {
|
||||||
|
Name string
|
||||||
Contract string
|
Contract string
|
||||||
Action string
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a Action) Channel() Channel {
|
func (a Action) Channel() Channel {
|
||||||
|
|
@ -49,8 +49,8 @@ func (a Action) Channel() Channel {
|
||||||
ch.Append("contract", a.Contract)
|
ch.Append("contract", a.Contract)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(a.Action) > 0 {
|
if len(a.Name) > 0 {
|
||||||
ch.Append("action", a.Action)
|
ch.Append("name", a.Name)
|
||||||
}
|
}
|
||||||
|
|
||||||
return ch
|
return ch
|
||||||
|
|
|
||||||
|
|
@ -51,8 +51,8 @@ func TestActionChannel_String(t *testing.T) {
|
||||||
}{
|
}{
|
||||||
{"Empty", Action{}.Channel(), "actions"},
|
{"Empty", Action{}.Channel(), "actions"},
|
||||||
{"Contract", Action{Contract: "mycontract"}.Channel(), "actions/contract/mycontract"},
|
{"Contract", Action{Contract: "mycontract"}.Channel(), "actions/contract/mycontract"},
|
||||||
{"Action", Action{Action: "myaction"}.Channel(), "actions/action/myaction"},
|
{"Action", Action{Name: "myaction"}.Channel(), "actions/name/myaction"},
|
||||||
{"ContractAndAction", Action{Contract: "mycontract", Action: "myaction"}.Channel(), "actions/contract/mycontract/action/myaction"},
|
{"ContractAndName", Action{Contract: "mycontract", Name: "myaction"}.Channel(), "actions/contract/mycontract/name/myaction"},
|
||||||
}
|
}
|
||||||
for _, tt := range tests {
|
for _, tt := range tests {
|
||||||
t.Run(tt.name, func(t *testing.T) {
|
t.Run(tt.name, func(t *testing.T) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue