Skip to content

Commit 6bba5a6

Browse files
author
Jeff Yanta
committed
Remove deprecated phone verification check on SubmitIntent account creation
1 parent f451c0d commit 6bba5a6

File tree

2 files changed

+6
-15
lines changed

2 files changed

+6
-15
lines changed

pkg/code/server/transaction/errors.go

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,21 +23,14 @@ const (
2323
var (
2424
ErrTimedOutReceivingRequest = errors.New("timed out receiving request")
2525

26-
ErrNotPhoneVerified = newIntentDeniedError("not phone verified")
2726
ErrTooManyPayments = newIntentDeniedError("too many payments")
28-
ErrTooManyNewRelationships = newIntentDeniedError("too many new relationships")
2927
ErrTransactionLimitExceeded = newIntentDeniedError("dollar value exceeds limit")
3028
ErrNotManagedByCode = newIntentDeniedError("at least one account is no longer managed by code")
3129

3230
ErrInvalidSignature = errors.New("invalid signature provided")
3331
ErrMissingSignature = errors.New("at least one signature is missing")
3432
ErrTooManySignatures = errors.New("too many signatures provided")
3533

36-
ErrInvalidActionToUpgrade = errors.New("attempt to upgrade an action that isn't upgradeable")
37-
ErrPrivacyUpgradeMissed = errors.New("opportunity to upgrade the private transaction was missed")
38-
ErrPrivacyAlreadyUpgraded = errors.New("private transaction has already been upgraded")
39-
ErrWaitForNextBlock = errors.New("must wait for next block before attempting privacy upgrade")
40-
4134
ErrNotImplemented = errors.New("feature not implemented")
4235
)
4336

pkg/code/server/transaction/intent.go

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,11 @@ func (s *transactionServer) SubmitIntent(streamer transactionpb.Transaction_Subm
9090

9191
// Figure out what kind of intent we're operating on and initialize the intent handler
9292
var intentHandler interface{}
93+
var intentHasNewOwner bool // todo: intent handler should specify this
9394
switch submitActionsReq.Metadata.Type.(type) {
9495
case *transactionpb.Metadata_OpenAccounts:
9596
log = log.WithField("intent_type", "open_accounts")
97+
intentHasNewOwner = true
9698
intentHandler = NewOpenAccountsIntentHandler(s.conf, s.data, s.antispamGuard)
9799
case *transactionpb.Metadata_SendPublicPayment:
98100
log = log.WithField("intent_type", "send_public_payment")
@@ -120,8 +122,6 @@ func (s *transactionServer) SubmitIntent(streamer transactionpb.Transaction_Subm
120122
}
121123
log = log.WithField("submit_actions_owner_account", submitActionsOwnerAccount.PublicKey().ToBase58())
122124

123-
// For all allowed cases of owner account types that can call SubmitIntent,
124-
// we need to find the phone-verified user's 12 words who initiated the intent.
125125
var initiatorOwnerAccount *common.Account
126126
submitActionsOwnerMetadata, err := common.GetOwnerMetadata(ctx, s.data, submitActionsOwnerAccount)
127127
if err == nil {
@@ -164,17 +164,15 @@ func (s *transactionServer) SubmitIntent(streamer transactionpb.Transaction_Subm
164164
return handleSubmitIntentError(streamer, errors.New("unhandled owner account type"))
165165
}
166166
} else if err == common.ErrOwnerNotFound {
167-
// Caught by later error
167+
if !intentHasNewOwner {
168+
return handleSubmitIntentError(streamer, newIntentDeniedError("unexpected owner account"))
169+
}
170+
initiatorOwnerAccount = submitActionsOwnerAccount
168171
} else if err != nil {
169172
log.WithError(err).Warn("failure getting owner account metadata")
170173
return handleSubmitIntentError(streamer, err)
171174
}
172175

173-
// All intents must be initiated by a phone-verified user
174-
if initiatorOwnerAccount == nil {
175-
log.Info("intent not initiated by phone-verified user 12 words")
176-
return handleSubmitIntentError(streamer, ErrNotPhoneVerified)
177-
}
178176
log = log.WithField("initiator_owner_account", initiatorOwnerAccount.PublicKey().ToBase58())
179177

180178
// Check that all provided signatures in proto messages are valid

0 commit comments

Comments
 (0)