Skip to content

Commit 34604d8

Browse files
committed
rename ActionType to ActionLabel
1 parent d789cdc commit 34604d8

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

solana/parser_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -593,6 +593,7 @@ func TestJupiterAggregatorV6Route_1(t *testing.T) {
593593
assert.Equal(t, swapAction.ProgramID, jupiterAggregatorV6.Program)
594594
assert.Equal(t, swapAction.ProgramName, jupiterAggregatorV6.ProgramName)
595595
assert.Equal(t, swapAction.InstructionName, "Route")
596+
assert.Equal(t, swapAction.ActionLabel, "SWAP")
596597
assert.Equal(t, swapAction.Who, "3huskHPRJXT5pL6RW57HaA8pXRFojx6gfNVGL9cJ2vtB")
597598
assert.Equal(t, swapAction.FromToken, "So11111111111111111111111111111111111111112")
598599
assert.Equal(t, swapAction.FromTokenAmount, uint64(400000000))
@@ -615,6 +616,7 @@ func TestJupiterAggregatorV6Route_2(t *testing.T) {
615616
assert.Equal(t, swapAction.ProgramID, jupiterAggregatorV6.Program)
616617
assert.Equal(t, swapAction.ProgramName, jupiterAggregatorV6.ProgramName)
617618
assert.Equal(t, swapAction.InstructionName, "Route")
619+
assert.Equal(t, swapAction.ActionLabel, "SWAP")
618620
assert.Equal(t, swapAction.Who, "63EazyqF9nJN8SdGTMUaLrRKxS3XnmUiFuDp5KZ9wEV8")
619621
assert.Equal(t, swapAction.FromToken, "8SgNwESovnbG1oNEaPVhg6CR9mTMSK7jPvcYRe3wpump")
620622
assert.Equal(t, swapAction.FromTokenAmount, uint64(100000000))

solana/programs/jupiterAggregatorV6/parsers/route.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ func RouteParser(result *types.ParsedResult, instruction types.Instruction) (*ju
114114
ProgramID: result.AccountList[instruction.ProgramIDIndex],
115115
ProgramName: jupiterAggregatorV6.ProgramName,
116116
InstructionName: "Route",
117-
ActionType: "SWAP",
117+
ActionLabel: "SWAP",
118118
},
119119
SwapActionMixin: types.SwapActionMixin{
120120
Who: user,

solana/types/abstract_actions.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ type Action interface {
44
GetProgramID() string
55
GetProgramName() string
66
GetInstructionName() string
7-
GetActionType() string
7+
GetActionLabel() string
88
}
99

1010
type BaseAction struct {
1111
ProgramID string `json:"programId"`
1212
ProgramName string `json:"programName"`
1313
InstructionName string `json:"instructionName"`
14-
ActionType string `json:"actionType"`
14+
ActionLabel string `json:"actionLabel"`
1515
}
1616

1717
func (a BaseAction) GetProgramID() string {
@@ -26,8 +26,8 @@ func (a BaseAction) GetInstructionName() string {
2626
return a.InstructionName
2727
}
2828

29-
func (a BaseAction) GetActionType() string {
30-
return a.ActionType
29+
func (a BaseAction) GetActionLabel() string {
30+
return a.ActionLabel
3131
}
3232

3333
type UnknownAction struct {

0 commit comments

Comments
 (0)