Skip to content

Commit bd97496

Browse files
committed
accounts: fix function names in doc
1 parent cb97c48 commit bd97496

File tree

13 files changed

+34
-29
lines changed

13 files changed

+34
-29
lines changed

accounts/abi/abigen/bind_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2084,8 +2084,8 @@ var bindTests = []struct {
20842084
},
20852085
}
20862086

2087-
// Tests that packages generated by the binder can be successfully compiled and
2088-
// the requested tester run against it.
2087+
// TestBindings tests that packages generated by the binder can be successfully
2088+
// compiled and the requested tester run against it.
20892089
func TestBindings(t *testing.T) {
20902090
t.Parallel()
20912091
// Skip the test if no Go command can be found

accounts/abi/abigen/bindv2.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -186,9 +186,9 @@ func (cb *contractBinder) bindMethod(original abi.Method) error {
186186
return nil
187187
}
188188

189-
// normalize a set of arguments by stripping underscores, giving a generic name
190-
// in the case where the arg name collides with a reserved Go keyword, and finally
191-
// converting to camel-case.
189+
// normalizeArgs normalizes a set of arguments by stripping underscores,
190+
// giving a generic name in the case where the arg name collides with
191+
// a reserved Go keyword, and finally converting to camel-case.
192192
func normalizeArgs(args abi.Arguments) abi.Arguments {
193193
args = slices.Clone(args)
194194
used := make(map[string]bool)

accounts/abi/abigen/bindv2_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,8 @@ func TestNormalizeArgs(t *testing.T) {
323323
}
324324
}
325325

326-
// returns a "pretty diff" on two strings. Useful if the strings are large.
326+
// prettyDiff returns a "pretty diff" on two strings. Useful if the strings
327+
// are large.
327328
func prettyDiff(have, want string) string {
328329
if have == want {
329330
return ""

accounts/abi/abigen/source2.go.tpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ var (
225225
{{capitalise .Name}} {{if .Indexed}}{{bindtopictype .Type $structs}}{{else}}{{bindtype .Type $structs}}{{end}}; {{end}}
226226
}
227227

228-
// ErrorID returns the hash of canonical representation of the error's signature.
228+
// {{$contract.Type}}{{.Normalized.Name}}ErrorID returns the hash of canonical representation of the error's signature.
229229
//
230230
// Solidity: {{.Original.String}}
231231
func {{$contract.Type}}{{.Normalized.Name}}ErrorID() common.Hash {

accounts/abi/bind/v2/internal/contracts/solc_errors/bindings.go

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

accounts/abi/bind/v2/lib_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,8 @@ func makeTestDeployerWithNonceAssignment(backend simulated.Client) func(input, d
7373
return bind.DeployerWithNonceAssignment(bind.NewKeyedTransactor(testKey, chainId), backend)
7474
}
7575

76-
// test that deploying a contract with library dependencies works,
77-
// verifying by calling method on the deployed contract.
76+
// TestDeploymentLibraries tests that deploying a contract with library
77+
// dependencies works, verifying by calling method on the deployed contract.
7878
func TestDeploymentLibraries(t *testing.T) {
7979
bindBackend, err := testSetup()
8080
if err != nil {
@@ -117,8 +117,8 @@ func TestDeploymentLibraries(t *testing.T) {
117117
}
118118
}
119119

120-
// Same as TestDeployment. However, stagger the deployments with overrides:
121-
// first deploy the library deps and then the contract.
120+
// TestDeploymentWithOverrides is same as TestDeployment. However, stagger the
121+
// deployments with overrides: first deploy the library deps and then the contract.
122122
func TestDeploymentWithOverrides(t *testing.T) {
123123
bindBackend, err := testSetup()
124124
if err != nil {
@@ -185,7 +185,7 @@ func TestDeploymentWithOverrides(t *testing.T) {
185185
}
186186
}
187187

188-
// returns transaction auth to send a basic transaction from testAddr
188+
// defaultTxAuth returns transaction auth to send a basic tx from testAddr
189189
func defaultTxAuth() *bind.TransactOpts {
190190
signer := types.LatestSigner(params.AllDevChainProtocolChanges)
191191
opts := &bind.TransactOpts{

accounts/abi/type_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ import (
2929
// the stringer interface to allow printing type details in the tests below.
3030
type typeWithoutStringer Type
3131

32-
// Tests that all allowed types get recognized by the type parser.
32+
// TestTypeRegexp tests that all allowed types get recognized by the type parser.
3333
func TestTypeRegexp(t *testing.T) {
3434
t.Parallel()
3535
tests := []struct {

accounts/abi/unpack.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,9 +121,11 @@ func readBool(word []byte) (bool, error) {
121121
}
122122
}
123123

124-
// A function type is simply the address with the function selection signature at the end.
124+
// readFunctionType enforces that standard by always presenting it as
125+
// a 24-array (address + sig = 24 bytes)
125126
//
126-
// readFunctionType enforces that standard by always presenting it as a 24-array (address + sig = 24 bytes)
127+
// A function type is simply the address with the function selection
128+
// signature at the end.
127129
func readFunctionType(t Type, word []byte) (funcTy [24]byte, err error) {
128130
if t.T != FunctionTy {
129131
return [24]byte{}, errors.New("abi: invalid type in call to make function type byte array")

accounts/hd_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ import (
2222
"testing"
2323
)
2424

25-
// Tests that HD derivation paths can be correctly parsed into our internal binary
26-
// representation.
25+
// TestHDPathParsing tests that HD derivation paths can be correctly
26+
// parsed into our internal binary representation.
2727
func TestHDPathParsing(t *testing.T) {
2828
t.Parallel()
2929
tests := []struct {

accounts/keystore/keystore_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ func TestOverrideUnlock(t *testing.T) {
190190
}
191191
}
192192

193-
// This test should fail under -race if signing races the expiration goroutine.
193+
// TestSignRace should fail under -race if signing races the expiration goroutine.
194194
func TestSignRace(t *testing.T) {
195195
t.Parallel()
196196
_, ks := tmpKeyStore(t)
@@ -233,8 +233,8 @@ func waitForKsUpdating(t *testing.T, ks *KeyStore, wantStatus bool, maxTime time
233233
return false
234234
}
235235

236-
// Tests that the wallet notifier loop starts and stops correctly based on the
237-
// addition and removal of wallet event subscriptions.
236+
// TestWalletNotifierLifecycle tests that the wallet notifier loop starts and stops correctly
237+
// based on the addition and removal of wallet event subscriptions.
238238
func TestWalletNotifierLifecycle(t *testing.T) {
239239
t.Parallel()
240240
// Create a temporary keystore to test with
@@ -280,8 +280,8 @@ type walletEvent struct {
280280
a accounts.Account
281281
}
282282

283-
// Tests that wallet notifications and correctly fired when accounts are added
284-
// or deleted from the keystore.
283+
// TestWalletNotifications tests that wallet notifications and correctly fired
284+
// when accounts are added or deleted from the keystore.
285285
func TestWalletNotifications(t *testing.T) {
286286
t.Parallel()
287287
_, ks := tmpKeyStore(t)

0 commit comments

Comments
 (0)