diff --git a/accounts/abi/bind/template2.go b/accounts/abi/bind/source2.go.tpl similarity index 97% rename from accounts/abi/bind/template2.go rename to accounts/abi/bind/source2.go.tpl index 0e97dd39c3..35b3e47b85 100644 --- a/accounts/abi/bind/template2.go +++ b/accounts/abi/bind/source2.go.tpl @@ -1,8 +1,3 @@ -package bind - -// tmplSourceV2 is the Go source template that the generated -// Go contract binding V2 is based on. -const tmplSourceV2 = ` // Code generated via abigen V2 - DO NOT EDIT. // This file is a generated binding and any manual changes will be lost. @@ -150,5 +145,4 @@ var ( return out, nil } {{end}} -{{end}} -` +{{end}} \ No newline at end of file diff --git a/accounts/abi/bind/template.go b/accounts/abi/bind/template.go index f304286ffb..7dce6f9558 100644 --- a/accounts/abi/bind/template.go +++ b/accounts/abi/bind/template.go @@ -83,3 +83,9 @@ type tmplStruct struct { // //go:embed source.go.tpl var tmplSource string + +// tmplSourceV2 is the Go source template that the generated Go contract binding +// for abigen v2 is based on. +// +//go:embed source2.go.tpl +var tmplSourceV2 string diff --git a/accounts/abi/bind/v2/backend.go b/accounts/abi/bind/v2/backend.go index 73b420a27e..ca4162efab 100644 --- a/accounts/abi/bind/v2/backend.go +++ b/accounts/abi/bind/v2/backend.go @@ -1,3 +1,19 @@ +// Copyright 2024 The go-ethereum Authors +// This file is part of the go-ethereum library. +// +// The go-ethereum library is free software: you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// The go-ethereum library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public License +// along with the go-ethereum library. If not, see . + package v2 import ( @@ -8,7 +24,7 @@ import ( "math/big" ) -type V2Backend interface { +type BackendV2 interface { SuggestGasPrice(ctx context.Context) (*big.Int, error) PendingCodeAt(ctx context.Context, account common.Address) ([]byte, error) PendingNonceAt(ctx context.Context, account common.Address) (uint64, error) diff --git a/accounts/abi/bind/v2/lib.go b/accounts/abi/bind/v2/lib.go index 3fb97ac956..e160bc2e08 100644 --- a/accounts/abi/bind/v2/lib.go +++ b/accounts/abi/bind/v2/lib.go @@ -1,3 +1,19 @@ +// Copyright 2024 The go-ethereum Authors +// This file is part of the go-ethereum library. +// +// The go-ethereum library is free software: you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// The go-ethereum library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public License +// along with the go-ethereum library. If not, see . + package v2 import ( diff --git a/accounts/abi/bind/v2/lib_test.go b/accounts/abi/bind/v2/lib_test.go index 4e04d9136f..ff96e92b21 100644 --- a/accounts/abi/bind/v2/lib_test.go +++ b/accounts/abi/bind/v2/lib_test.go @@ -1,3 +1,19 @@ +// Copyright 2024 The go-ethereum Authors +// This file is part of the go-ethereum library. +// +// The go-ethereum library is free software: you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// The go-ethereum library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public License +// along with the go-ethereum library. If not, see . + package v2 import ( @@ -47,7 +63,7 @@ func TestDeployment(t *testing.T) { ) defer backend.Close() - _, err := JSON(strings.NewReader(v2_generated_testcase.V2GeneratedTestcaseMetaData.ABI)) + _, err := JSON(strings.NewReader(nested_libraries.C1MetaData.ABI)) if err != nil { panic(err) }