@@ -43,33 +43,19 @@ type newFulfillmentMetadata struct {
4343 disableActiveScheduling bool
4444}
4545
46- // BaseActionHandler is a base interface for operation-specific action handlers
47- //
48- // Note: Action handlers should load all required state on initialization to
49- // avoid duplicated work across interface method calls.
50- type BaseActionHandler interface {
51- // GetServerParameter gets the server parameter for the action within the context
52- // of the intent.
53- GetServerParameter () * transactionpb.ServerParameter
54-
55- // OnSaveToDB is a callback when the action is being saved to the DB
56- // within the scope of a DB transaction. Additional supporting DB records
57- // (ie. not the action or fulfillment records) relevant to the action should
58- // be saved here.
59- OnSaveToDB (ctx context.Context ) error
60- }
61-
6246// CreateActionHandler is an interface for creating new actions
6347type CreateActionHandler interface {
64- BaseActionHandler
65-
6648 // FulfillmentCount returns the total number of fulfillments that
6749 // will be created for the action.
6850 FulfillmentCount () int
6951
7052 // PopulateMetadata populates action metadata into the provided record
7153 PopulateMetadata (actionRecord * action.Record ) error
7254
55+ // GetServerParameter gets the server parameter for the action within the context
56+ // of the intent.
57+ GetServerParameter () * transactionpb.ServerParameter
58+
7359 // RequiresNonce determines whether a nonce should be acquired for the
7460 // fulfillment being created. This should be true whenever a virtual
7561 // instruction needs to be signed by the client.
@@ -81,22 +67,12 @@ type CreateActionHandler interface {
8167 nonce * common.Account ,
8268 bh solana.Blockhash ,
8369 ) (* newFulfillmentMetadata , error )
84- }
85-
86- // UpgradeActionHandler is an interface for upgrading existing actions. It's
87- // assumed we'll only be upgrading a single fulfillment.
88- type UpgradeActionHandler interface {
89- BaseActionHandler
9070
91- // GetFulfillmentBeingUpgraded gets the original fulfillment that's being
92- // upgraded.
93- GetFulfillmentBeingUpgraded () * fulfillment.Record
94-
95- // GetFulfillmentMetadata gets upgraded fulfillment metadata
96- GetFulfillmentMetadata (
97- nonce * common.Account ,
98- bh solana.Blockhash ,
99- ) (* newFulfillmentMetadata , error )
71+ // OnSaveToDB is a callback when the action is being saved to the DB
72+ // within the scope of a DB transaction. Additional supporting DB records
73+ // (ie. not the action or fulfillment records) relevant to the action should
74+ // be saved here.
75+ OnSaveToDB (ctx context.Context ) error
10076}
10177
10278type OpenAccountActionHandler struct {
0 commit comments