Skip to content

Commit 91f36b9

Browse files
committed
fix CI
1 parent 63a7732 commit 91f36b9

File tree

4 files changed

+12
-12
lines changed

4 files changed

+12
-12
lines changed

commentapi/comment.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ type CreateArgs struct {
9090
IsProtected bool `json:"is_protected"`
9191
Amount *float64 `json:"amount"`
9292
DryRun bool `json:"dry_run"`
93-
PaymentTxId *string `json:"payment_tx_id"`
93+
PaymentTxID *string `json:"payment_tx_id"`
9494
}
9595

9696
// CreateResponse response for the comment.Create rpc call

server/lbry/apis.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,8 @@ type ArweavePaymentDetailsResponse struct {
9595
Amount uint64 `json:"amount"`
9696
Currency string `json:"currency"`
9797
Status string `json:"status"`
98-
UserId uint64 `json:"user_id"`
99-
ChannelClaimId string `json:"channel_claim_id"`
98+
UserID uint64 `json:"user_id"`
99+
ChannelClaimID string `json:"channel_claim_id"`
100100
TippedAt time.Time `json:"tipped_at"`
101101
}
102102
type apiArweavePaymentDetailsResponse struct {
@@ -105,12 +105,12 @@ type apiArweavePaymentDetailsResponse struct {
105105
Data ArweavePaymentDetailsResponse `json:"data"`
106106
}
107107

108-
func (c apiClient) GetDetailsForTransaction(txId string) (*ArweavePaymentDetailsResponse, error) {
108+
func (c apiClient) GetDetailsForTransaction(txID string) (*ArweavePaymentDetailsResponse, error) {
109109
const apiPath = "/arweave/payment/retrieve"
110110
client := http.Client{}
111111
form := make(url.Values)
112112
form.Set("auth_token", apiToken)
113-
form.Set("tx_id", txId)
113+
form.Set("tx_id", txID)
114114

115115
response, err := client.PostForm(apiURL+apiPath, form)
116116
if err != nil {

server/lbry/client.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,6 @@ func (m *mockAPI) CheckPerk(options CheckPerkOptions) (bool, error) {
9696
return false, nil
9797
}
9898

99-
func (m *mockAPI) GetDetailsForTransaction(txId string) (*ArweavePaymentDetailsResponse, error) {
99+
func (m *mockAPI) GetDetailsForTransaction(txID string) (*ArweavePaymentDetailsResponse, error) {
100100
return nil, nil
101101
}

server/services/v1/comments/create.go

+6-6
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ func create(_ *http.Request, args *commentapi.CreateArgs, reply *commentapi.Crea
9090
frequencyCheck = ignoreFrequency
9191
}
9292

93-
if args.SupportTxID != nil || args.PaymentIntentID != nil || args.PaymentTxId != nil {
93+
if args.SupportTxID != nil || args.PaymentIntentID != nil || args.PaymentTxID != nil {
9494
if args.DryRun {
9595
if args.Amount != nil {
9696
if args.PaymentIntentID != nil {
@@ -102,7 +102,7 @@ func create(_ *http.Request, args *commentapi.CreateArgs, reply *commentapi.Crea
102102
return errors.Err(err)
103103
}
104104
request.comment.Amount.SetValid(uint64(lbc.ToUnit(btcutil.AmountSatoshi)))
105-
} else if args.PaymentTxId != nil {
105+
} else if args.PaymentTxID != nil {
106106
//assume cents
107107
request.comment.Amount.SetValid(uint64(*args.Amount))
108108
}
@@ -792,9 +792,9 @@ func updateSupportInfoAttempt(request *createRequest, retry bool) error {
792792
}
793793
request.comment.Amount.SetValid(amount)
794794
return nil
795-
} else if request.args.PaymentTxId != nil {
795+
} else if request.args.PaymentTxID != nil {
796796
//check for replays
797-
existingComment, err := m.Comments(m.CommentWhere.TXID.EQ(null.StringFromPtr(request.args.PaymentTxId))).One(db.RO)
797+
existingComment, err := m.Comments(m.CommentWhere.TXID.EQ(null.StringFromPtr(request.args.PaymentTxID))).One(db.RO)
798798
if err != nil && !errors.Is(err, sql.ErrNoRows) {
799799
if !errors.Is(err, sql.ErrNoRows) {
800800
return errors.Err(err)
@@ -804,14 +804,14 @@ func updateSupportInfoAttempt(request *createRequest, retry bool) error {
804804
return errors.Err("a comment with this transaction id already exists")
805805
}
806806
//query internal apis to verify the transaction
807-
pi, err := lbry.API.GetDetailsForTransaction(*request.args.PaymentTxId)
807+
pi, err := lbry.API.GetDetailsForTransaction(*request.args.PaymentTxID)
808808
if err != nil {
809809
return err
810810
}
811811
if pi.Status != "confirmed" {
812812
return errors.Err("transaction is not confirmed")
813813
}
814-
if pi.ChannelClaimId != request.args.ChannelID {
814+
if pi.ChannelClaimID != request.args.ChannelID {
815815
return errors.Err("channel mismatch for transaction")
816816
}
817817
if time.Since(pi.TippedAt) > time.Hour {

0 commit comments

Comments
 (0)