Skip to content

Commit 9324839

Browse files
committed
Require checkpoint for intent configuration
1 parent f0642e3 commit 9324839

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

intent_config.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ func CreateIntentTree(mainSigner common.Address, calls []*v3.CallsPayload, sapie
239239
}
240240

241241
// `CreateIntentConfiguration` creates a wallet configuration where the intent's transaction batches are grouped into the initial subdigest.
242-
func CreateIntentConfiguration(mainSigner common.Address, calls []*v3.CallsPayload, sapientSignerLeafNode v3.WalletConfigTree) (*v3.WalletConfig, error) {
242+
func CreateIntentConfiguration(mainSigner common.Address, calls []*v3.CallsPayload, sapientSignerLeafNode v3.WalletConfigTree, checkpoint uint64) (*v3.WalletConfig, error) {
243243
// Create the subdigest leaves from the batched transactions.
244244
tree, err := CreateIntentTree(mainSigner, calls, sapientSignerLeafNode)
245245
if err != nil {
@@ -249,7 +249,7 @@ func CreateIntentConfiguration(mainSigner common.Address, calls []*v3.CallsPaylo
249249
// Construct the new wallet config using:
250250
config := &v3.WalletConfig{
251251
Threshold_: 1,
252-
Checkpoint_: 0,
252+
Checkpoint_: checkpoint,
253253
Tree: *tree,
254254
}
255255

@@ -262,6 +262,7 @@ func CreateIntentConfigurationWithMalleableSapient(
262262
mainSigner common.Address,
263263
payloads []*v3.CallsPayload,
264264
configs []MalleableSapientConfig,
265+
checkpoint uint64,
265266
) (*v3.WalletConfig, error) {
266267
if len(payloads) == 0 {
267268
return nil, fmt.Errorf("calls cannot be empty")
@@ -308,7 +309,7 @@ func CreateIntentConfigurationWithMalleableSapient(
308309
}
309310

310311
// Remaining calls go to CreateIntentConfiguration
311-
return CreateIntentConfiguration(mainSigner, callsWithoutMalleableSapient, sapientSignerTree)
312+
return CreateIntentConfiguration(mainSigner, callsWithoutMalleableSapient, sapientSignerTree, checkpoint)
312313
}
313314

314315
type SignerSignature struct {

services/trailsapi/trailsapi.gen.go

Lines changed: 7 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)