File tree Expand file tree Collapse file tree 2 files changed +0
-32
lines changed Expand file tree Collapse file tree 2 files changed +0
-32
lines changed Original file line number Diff line number Diff line change @@ -339,15 +339,6 @@ func (a Address) Value() (driver.Value, error) {
339339 return a [:], nil
340340}
341341
342- // Clone returns a pointer to a copy of [a] (or nil if [a] is nil)
343- func (a * Address ) Clone () * Address {
344- if a == nil {
345- return nil
346- }
347- cpy := * a
348- return & cpy
349- }
350-
351342// ImplementsGraphQLType returns true if Hash implements the specified GraphQL type.
352343func (a Address ) ImplementsGraphQLType (name string ) bool { return name == "Address" }
353344
Original file line number Diff line number Diff line change @@ -453,29 +453,6 @@ func TestAddress_Format(t *testing.T) {
453453 }
454454}
455455
456- func TestCopyAddress (t * testing.T ) {
457- addrBytes := make ([]byte , 20 )
458- addr := BytesToAddress (addrBytes )
459- if ! bytes .Equal (addr .Bytes (), addrBytes ) {
460- t .Fatalf ("Expected original address bytes to be unmodified" )
461- }
462- addrPtr := & addr
463- cpy := addrPtr .Clone ()
464- cpy .SetBytes ([]byte ("deadbeef" ))
465- if ! bytes .Equal (addr .Bytes (), addrBytes ) {
466- t .Fatal ("Expected original address bytes to be unmodified" )
467- }
468- if bytes .Equal (cpy .Bytes (), addrBytes ) {
469- t .Fatal ("Expected modified address to no longer match original byte slice" )
470- }
471-
472- var nilAddr * Address
473- copiedNilAddr := nilAddr .Clone ()
474- if copiedNilAddr != nil {
475- t .Fatalf ("Expected copied nil address to be nil, but got %s" , copiedNilAddr )
476- }
477- }
478-
479456func TestHash_Format (t * testing.T ) {
480457 var hash Hash
481458 hash .SetBytes ([]byte {
You can’t perform that action at this time.
0 commit comments