chore: go fmt

This commit is contained in:
2025-08-15 15:56:10 -04:00
parent 6fc3e9a049
commit acd2c41447
6 changed files with 28 additions and 28 deletions

View File

@@ -13,7 +13,7 @@ import (
func generateSimpleEvent(signer *testSigner, contentSize int) *event.E {
content := generateContent(contentSize)
ev := &event.E{
Kind: kind.TextNote,
Tags: tags.New(),
@@ -21,11 +21,11 @@ func generateSimpleEvent(signer *testSigner, contentSize int) *event.E {
CreatedAt: timestamp.Now(),
Pubkey: signer.Pub(),
}
if err := ev.Sign(signer); chk.E(err) {
panic(fmt.Sprintf("failed to sign event: %v", err))
}
return ev
}
@@ -42,7 +42,7 @@ func generateContent(size int) string {
"back", "after", "use", "two", "how", "our", "work", "first", "well", "way",
"even", "new", "want", "because", "any", "these", "give", "day", "most", "us",
}
result := ""
for len(result) < size {
if len(result) > 0 {
@@ -50,10 +50,10 @@ func generateContent(size int) string {
}
result += words[frand.Intn(len(words))]
}
if len(result) > size {
result = result[:size]
}
return result
}
}

View File

@@ -18,4 +18,4 @@ func newTestSigner() *testSigner {
return &testSigner{Signer: s}
}
var _ signer.I = (*testSigner)(nil)
var _ signer.I = (*testSigner)(nil)

View File

@@ -97,8 +97,8 @@ func main() {
sub, err := relay.Subscribe(
c, filters.New(
&filter.F{
Kinds: kinds.New(kind.WalletRequest),
Tags: tags.New(tag.New("#p", hex.Enc(walletSigner.Pub()))),
Kinds: kinds.New(kind.WalletRequest),
Tags: tags.New(tag.New("#p", hex.Enc(walletSigner.Pub()))),
},
),
)
@@ -453,4 +453,4 @@ func handleSignMessage() *nwc.SignMessageResult {
Message: "Mock message",
Signature: "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef",
}
}
}

View File

@@ -154,7 +154,7 @@ func TestDeletionEventWithETagRejection(t *testing.T) {
// Try to save the deletion event
_, _, err = db.SaveEvent(ctx, deletionEvent, false, nil)
}
if err == nil {
t.Fatal("Expected deletion event with e-tag to be rejected, but it was accepted")
}

View File

@@ -4,22 +4,22 @@ package nwc
type Capability []byte
var (
CancelHoldInvoice = Capability("cancel_hold_invoice")
CreateConnection = Capability("create_connection")
GetBalance = Capability("get_balance")
GetBudget = Capability("get_budget")
GetInfo = Capability("get_info")
CancelHoldInvoice = Capability("cancel_hold_invoice")
CreateConnection = Capability("create_connection")
GetBalance = Capability("get_balance")
GetBudget = Capability("get_budget")
GetInfo = Capability("get_info")
GetWalletServiceInfo = Capability("get_wallet_service_info")
ListTransactions = Capability("list_transactions")
LookupInvoice = Capability("lookup_invoice")
MakeHoldInvoice = Capability("make_hold_invoice")
MakeInvoice = Capability("make_invoice")
MultiPayInvoice = Capability("multi_pay_invoice")
MultiPayKeysend = Capability("multi_pay_keysend")
PayInvoice = Capability("pay_invoice")
PayKeysend = Capability("pay_keysend")
SettleHoldInvoice = Capability("settle_hold_invoice")
SignMessage = Capability("sign_message")
ListTransactions = Capability("list_transactions")
LookupInvoice = Capability("lookup_invoice")
MakeHoldInvoice = Capability("make_hold_invoice")
MakeInvoice = Capability("make_invoice")
MultiPayInvoice = Capability("multi_pay_invoice")
MultiPayKeysend = Capability("multi_pay_keysend")
PayInvoice = Capability("pay_invoice")
PayKeysend = Capability("pay_keysend")
SettleHoldInvoice = Capability("settle_hold_invoice")
SignMessage = Capability("sign_message")
)
// EncryptionType represents the encryption type used for NIP-47 messages

View File

@@ -179,4 +179,4 @@ func (ws *WalletService) handleSignMessage(c context.T, params json.RawMessage)
// Empty stub implementation
return &SignMessageResult{}, nil
}
}