@@ -94,7 +94,7 @@ func (p *DCAPlugin) SigningComplete(
9494 ctx context.Context ,
9595 signature tss.KeysignResponse ,
9696 signRequest vtypes.PluginKeysignRequest ,
97- policy vtypes.PluginPolicyCreateUpdate ,
97+ policy vtypes.PluginPolicy ,
9898) error {
9999 var dcaPolicy DCAPolicy
100100 // TODO: convert recipe to DCAPolicy
@@ -135,7 +135,7 @@ func (p *DCAPlugin) SigningComplete(
135135 return nil
136136}
137137
138- func (p * DCAPlugin ) ValidatePluginPolicy (policyDoc vtypes.PluginPolicyCreateUpdate ) error {
138+ func (p * DCAPlugin ) ValidatePluginPolicy (policyDoc vtypes.PluginPolicy ) error {
139139 if policyDoc .PluginID != vtypes .PluginVultisigDCA_0000 {
140140 return fmt .Errorf ("policy does not match plugin type, expected: %s, got: %s" , pluginType , policyDoc .PluginID )
141141 }
@@ -144,7 +144,7 @@ func (p *DCAPlugin) ValidatePluginPolicy(policyDoc vtypes.PluginPolicyCreateUpda
144144 return fmt .Errorf ("policy does not match plugin version, expected: %s, got: %s" , pluginVersion , policyDoc .PluginVersion )
145145 }
146146
147- if policyDoc .PolicyVersion != policyVersion {
147+ if fmt . Sprintf ( "%d" , policyDoc .PolicyVersion ) != policyVersion { //TODO policy version will essentially be a nonce that is incremented by 1, not, like plugin versions that will follow traditional engineering versioning e.g. v2.12.3. For now we can compare string types
148148 return fmt .Errorf ("policy does not match policy version, expected: %s, got: %s" , policyVersion , policyDoc .PolicyVersion )
149149 }
150150
@@ -270,7 +270,7 @@ func validateInterval(intervalStr string, frequency string) error {
270270 return nil
271271}
272272
273- func (p * DCAPlugin ) ProposeTransactions (policy vtypes.PluginPolicyCreateUpdate ) ([]vtypes.PluginKeysignRequest , error ) {
273+ func (p * DCAPlugin ) ProposeTransactions (policy vtypes.PluginPolicy ) ([]vtypes.PluginKeysignRequest , error ) {
274274 p .logger .Info ("DCA: PROPOSE TRANSACTIONS" )
275275
276276 var txs []vtypes.PluginKeysignRequest
@@ -301,7 +301,7 @@ func (p *DCAPlugin) ProposeTransactions(policy vtypes.PluginPolicyCreateUpdate)
301301 }
302302
303303 if completedSwaps >= totalOrders .Int64 () {
304- if err := p .completePolicy (context .Background (), policy . ToPluginPolicy () ); err != nil {
304+ if err := p .completePolicy (context .Background (), policy ); err != nil {
305305 return txs , fmt .Errorf ("fail to complete policy: %w" , err )
306306 }
307307 return txs , ErrCompletedPolicy
@@ -358,7 +358,7 @@ func (p *DCAPlugin) ProposeTransactions(policy vtypes.PluginPolicyCreateUpdate)
358358 return txs , nil
359359}
360360
361- func (p * DCAPlugin ) ValidateProposedTransactions (policy vtypes.PluginPolicyCreateUpdate , txs []vtypes.PluginKeysignRequest ) error {
361+ func (p * DCAPlugin ) ValidateProposedTransactions (policy vtypes.PluginPolicy , txs []vtypes.PluginKeysignRequest ) error {
362362 p .logger .Info ("DCA: VALIDATE TRANSACTION PROPOSAL" )
363363
364364 if len (txs ) == 0 {
@@ -407,7 +407,7 @@ func (p *DCAPlugin) ValidateProposedTransactions(policy vtypes.PluginPolicyCreat
407407 }
408408 // TODO: Change this to make the policy to status COMPLETED if: completed swaps == total orders.
409409 if completedSwaps >= totalOrders .Int64 () {
410- if err := p .completePolicy (context .Background (), policy . ToPluginPolicy () ); err != nil {
410+ if err := p .completePolicy (context .Background (), policy ); err != nil {
411411 return fmt .Errorf ("fail to complete policy: %w" , err )
412412 }
413413 p .logger .Info ("DCA: COMPLETED SWAPS: " , totalOrders .Int64 ())
0 commit comments