From 9dd006f4e09b80f4508de04ef83787f04ae40eb7 Mon Sep 17 00:00:00 2001 From: Jared Wasinger Date: Tue, 7 Jan 2025 16:05:51 +0700 Subject: [PATCH] update converted v1 bindings remove commented-out line --- accounts/abi/bind/bindv2_test.go | 1 + .../convertedv1bindtests/crowdsale.go | 2 +- .../v2/internal/convertedv1bindtests/dao.go | 10 +++---- .../internal/convertedv1bindtests/getter.go | 2 +- .../internal/convertedv1bindtests/tupler.go | 2 +- .../convertedv1bindtests/underscorer.go | 26 +++++++++---------- 6 files changed, 22 insertions(+), 21 deletions(-) diff --git a/accounts/abi/bind/bindv2_test.go b/accounts/abi/bind/bindv2_test.go index 264d0944d0..64683c8cf1 100644 --- a/accounts/abi/bind/bindv2_test.go +++ b/accounts/abi/bind/bindv2_test.go @@ -344,6 +344,7 @@ func TestBindingV2ConvertedV1Tests(t *testing.T) { } // TODO: remove these before merging abigen2 PR. these are for convenience if I need to regenerate the converted bindings or add a new one. + if err := os.WriteFile(fmt.Sprintf("convertedv1bindtests/%s.go", strings.ToLower(tc.name)), []byte(code), 0666); err != nil { t.Fatalf("err writing expected output to file: %v\n", err) } diff --git a/accounts/abi/bind/v2/internal/convertedv1bindtests/crowdsale.go b/accounts/abi/bind/v2/internal/convertedv1bindtests/crowdsale.go index e5e6f89c6b..dd2ef4634a 100644 --- a/accounts/abi/bind/v2/internal/convertedv1bindtests/crowdsale.go +++ b/accounts/abi/bind/v2/internal/convertedv1bindtests/crowdsale.go @@ -139,7 +139,7 @@ func (crowdsale *Crowdsale) UnpackFunders(data []byte) (FundersOutput, error) { outstruct.Addr = *abi.ConvertType(out[0], new(common.Address)).(*common.Address) - outstruct.Amount = abi.ConvertType(out[1], new(big.Int)).(big.Int) + outstruct.Amount = abi.ConvertType(out[1], new(big.Int)).(*big.Int) return *outstruct, err diff --git a/accounts/abi/bind/v2/internal/convertedv1bindtests/dao.go b/accounts/abi/bind/v2/internal/convertedv1bindtests/dao.go index fdff6de91b..b159f12ee6 100644 --- a/accounts/abi/bind/v2/internal/convertedv1bindtests/dao.go +++ b/accounts/abi/bind/v2/internal/convertedv1bindtests/dao.go @@ -192,7 +192,7 @@ func (dAO *DAO) UnpackMembers(data []byte) (MembersOutput, error) { outstruct.Name = *abi.ConvertType(out[2], new(string)).(*string) - outstruct.MemberSince = abi.ConvertType(out[3], new(big.Int)).(big.Int) + outstruct.MemberSince = abi.ConvertType(out[3], new(big.Int)).(*big.Int) return *outstruct, err @@ -307,19 +307,19 @@ func (dAO *DAO) UnpackProposals(data []byte) (ProposalsOutput, error) { outstruct.Recipient = *abi.ConvertType(out[0], new(common.Address)).(*common.Address) - outstruct.Amount = abi.ConvertType(out[1], new(big.Int)).(big.Int) + outstruct.Amount = abi.ConvertType(out[1], new(big.Int)).(*big.Int) outstruct.Description = *abi.ConvertType(out[2], new(string)).(*string) - outstruct.VotingDeadline = abi.ConvertType(out[3], new(big.Int)).(big.Int) + outstruct.VotingDeadline = abi.ConvertType(out[3], new(big.Int)).(*big.Int) outstruct.Executed = *abi.ConvertType(out[4], new(bool)).(*bool) outstruct.ProposalPassed = *abi.ConvertType(out[5], new(bool)).(*bool) - outstruct.NumberOfVotes = abi.ConvertType(out[6], new(big.Int)).(big.Int) + outstruct.NumberOfVotes = abi.ConvertType(out[6], new(big.Int)).(*big.Int) - outstruct.CurrentResult = abi.ConvertType(out[7], new(big.Int)).(big.Int) + outstruct.CurrentResult = abi.ConvertType(out[7], new(big.Int)).(*big.Int) outstruct.ProposalHash = *abi.ConvertType(out[8], new([32]byte)).(*[32]byte) diff --git a/accounts/abi/bind/v2/internal/convertedv1bindtests/getter.go b/accounts/abi/bind/v2/internal/convertedv1bindtests/getter.go index 6fd6a03670..67ee1367ae 100644 --- a/accounts/abi/bind/v2/internal/convertedv1bindtests/getter.go +++ b/accounts/abi/bind/v2/internal/convertedv1bindtests/getter.go @@ -73,7 +73,7 @@ func (getter *Getter) UnpackGetter(data []byte) (GetterOutput, error) { outstruct.Arg0 = *abi.ConvertType(out[0], new(string)).(*string) - outstruct.Arg1 = abi.ConvertType(out[1], new(big.Int)).(big.Int) + outstruct.Arg1 = abi.ConvertType(out[1], new(big.Int)).(*big.Int) outstruct.Arg2 = *abi.ConvertType(out[2], new([32]byte)).(*[32]byte) diff --git a/accounts/abi/bind/v2/internal/convertedv1bindtests/tupler.go b/accounts/abi/bind/v2/internal/convertedv1bindtests/tupler.go index 7d0822cbce..94498af23d 100644 --- a/accounts/abi/bind/v2/internal/convertedv1bindtests/tupler.go +++ b/accounts/abi/bind/v2/internal/convertedv1bindtests/tupler.go @@ -73,7 +73,7 @@ func (tupler *Tupler) UnpackTuple(data []byte) (TupleOutput, error) { outstruct.A = *abi.ConvertType(out[0], new(string)).(*string) - outstruct.B = abi.ConvertType(out[1], new(big.Int)).(big.Int) + outstruct.B = abi.ConvertType(out[1], new(big.Int)).(*big.Int) outstruct.C = *abi.ConvertType(out[2], new([32]byte)).(*[32]byte) diff --git a/accounts/abi/bind/v2/internal/convertedv1bindtests/underscorer.go b/accounts/abi/bind/v2/internal/convertedv1bindtests/underscorer.go index 22aa343855..6e8ffa1a50 100644 --- a/accounts/abi/bind/v2/internal/convertedv1bindtests/underscorer.go +++ b/accounts/abi/bind/v2/internal/convertedv1bindtests/underscorer.go @@ -70,9 +70,9 @@ func (underscorer *Underscorer) UnpackAllPurelyUnderscoredOutput(data []byte) (A return *outstruct, err } - outstruct.Arg0 = abi.ConvertType(out[0], new(big.Int)).(big.Int) + outstruct.Arg0 = abi.ConvertType(out[0], new(big.Int)).(*big.Int) - outstruct.Arg1 = abi.ConvertType(out[1], new(big.Int)).(big.Int) + outstruct.Arg1 = abi.ConvertType(out[1], new(big.Int)).(*big.Int) return *outstruct, err @@ -98,9 +98,9 @@ func (underscorer *Underscorer) UnpackLowerLowerCollision(data []byte) (LowerLow return *outstruct, err } - outstruct.Res = abi.ConvertType(out[0], new(big.Int)).(big.Int) + outstruct.Res = abi.ConvertType(out[0], new(big.Int)).(*big.Int) - outstruct.Res0 = abi.ConvertType(out[1], new(big.Int)).(big.Int) + outstruct.Res0 = abi.ConvertType(out[1], new(big.Int)).(*big.Int) return *outstruct, err @@ -126,9 +126,9 @@ func (underscorer *Underscorer) UnpackLowerUpperCollision(data []byte) (LowerUpp return *outstruct, err } - outstruct.Res = abi.ConvertType(out[0], new(big.Int)).(big.Int) + outstruct.Res = abi.ConvertType(out[0], new(big.Int)).(*big.Int) - outstruct.Res0 = abi.ConvertType(out[1], new(big.Int)).(big.Int) + outstruct.Res0 = abi.ConvertType(out[1], new(big.Int)).(*big.Int) return *outstruct, err @@ -154,9 +154,9 @@ func (underscorer *Underscorer) UnpackPurelyUnderscoredOutput(data []byte) (Pure return *outstruct, err } - outstruct.Arg0 = abi.ConvertType(out[0], new(big.Int)).(big.Int) + outstruct.Arg0 = abi.ConvertType(out[0], new(big.Int)).(*big.Int) - outstruct.Res = abi.ConvertType(out[1], new(big.Int)).(big.Int) + outstruct.Res = abi.ConvertType(out[1], new(big.Int)).(*big.Int) return *outstruct, err @@ -182,7 +182,7 @@ func (underscorer *Underscorer) UnpackUnderscoredOutput(data []byte) (Underscore return *outstruct, err } - outstruct.Int = abi.ConvertType(out[0], new(big.Int)).(big.Int) + outstruct.Int = abi.ConvertType(out[0], new(big.Int)).(*big.Int) outstruct.String = *abi.ConvertType(out[1], new(string)).(*string) @@ -210,9 +210,9 @@ func (underscorer *Underscorer) UnpackUpperLowerCollision(data []byte) (UpperLow return *outstruct, err } - outstruct.Res = abi.ConvertType(out[0], new(big.Int)).(big.Int) + outstruct.Res = abi.ConvertType(out[0], new(big.Int)).(*big.Int) - outstruct.Res0 = abi.ConvertType(out[1], new(big.Int)).(big.Int) + outstruct.Res0 = abi.ConvertType(out[1], new(big.Int)).(*big.Int) return *outstruct, err @@ -238,9 +238,9 @@ func (underscorer *Underscorer) UnpackUpperUpperCollision(data []byte) (UpperUpp return *outstruct, err } - outstruct.Res = abi.ConvertType(out[0], new(big.Int)).(big.Int) + outstruct.Res = abi.ConvertType(out[0], new(big.Int)).(*big.Int) - outstruct.Res0 = abi.ConvertType(out[1], new(big.Int)).(big.Int) + outstruct.Res0 = abi.ConvertType(out[1], new(big.Int)).(*big.Int) return *outstruct, err