@@ -164,11 +164,11 @@ func (a BytesArgument) Describe(_ *ArgumentContext) string {
164
164
}
165
165
166
166
type AddressArgument struct {
167
- Value common. Address
167
+ Value string
168
168
}
169
169
170
170
func (a AddressArgument ) Describe (ctx * ArgumentContext ) string {
171
- description := a .Value . Hex () + " (address of <type unknown> from <chain unknown>)"
171
+ description := a .Value + " (address of <type unknown> from <chain unknown>)"
172
172
addresses , err := ContextGet [deployment.AddressesByChain ](ctx , "AddressesByChain" )
173
173
if err != nil {
174
174
return description
@@ -178,9 +178,9 @@ func (a AddressArgument) Describe(ctx *ArgumentContext) string {
178
178
if err != nil || chainName == "" {
179
179
chainName = strconv .FormatUint (chainSel , 10 )
180
180
}
181
- typeAndVersion , ok := addresses [a .Value . Hex () ]
181
+ typeAndVersion , ok := addresses [a .Value ]
182
182
if ok {
183
- return fmt .Sprintf ("%s (address of %s from %s)" , a .Value . Hex () , typeAndVersion .String (), chainName )
183
+ return fmt .Sprintf ("%s (address of %s from %s)" , a .Value , typeAndVersion .String (), chainName )
184
184
}
185
185
}
186
186
return description
@@ -195,7 +195,7 @@ type DecodedCall struct {
195
195
196
196
func (d * DecodedCall ) Describe (context * ArgumentContext ) string {
197
197
description := strings.Builder {}
198
- description .WriteString (fmt .Sprintf ("Address: %s\n " , AddressArgument {Value : common . HexToAddress ( d .Address ) }.Describe (context )))
198
+ description .WriteString (fmt .Sprintf ("Address: %s\n " , AddressArgument {Value : d .Address }.Describe (context )))
199
199
description .WriteString (fmt .Sprintf ("Method: %s\n " , d .Method ))
200
200
describedInputs := d .describeArguments (d .Inputs , context )
201
201
if len (describedInputs ) > 0 {
@@ -211,8 +211,11 @@ func (d *DecodedCall) Describe(context *ArgumentContext) string {
211
211
func (d * DecodedCall ) describeArguments (arguments []NamedArgument , context * ArgumentContext ) string {
212
212
description := strings.Builder {}
213
213
for _ , argument := range arguments {
214
- description .WriteString (argument .Describe (context ))
215
- description .WriteRune ('\n' )
214
+ describedContent := argument .Describe (context )
215
+ description .WriteString (describedContent )
216
+ if describedContent [len (describedContent )- 1 ] != '\n' {
217
+ description .WriteRune ('\n' )
218
+ }
216
219
}
217
220
return description .String ()
218
221
}
@@ -341,11 +344,11 @@ func BytesAndAddressAnalyzer(_ string, argAbi *abi.Type, argVal interface{}, _ [
341
344
if argAbi .T == abi .FixedBytesTy || argAbi .T == abi .BytesTy || argAbi .T == abi .AddressTy {
342
345
argArrTyp := reflect .ValueOf (argVal )
343
346
argArr := make ([]byte , argArrTyp .Len ())
344
- for i := 0 ; i < argArrTyp .Len (); i ++ {
347
+ for i := range argArrTyp .Len () {
345
348
argArr [i ] = byte (argArrTyp .Index (i ).Uint ())
346
349
}
347
350
if argAbi .T == abi .AddressTy {
348
- return AddressArgument {Value : common .BytesToAddress (argArr )}
351
+ return AddressArgument {Value : common .BytesToAddress (argArr ). Hex () }
349
352
}
350
353
return BytesArgument {Value : argArr }
351
354
}
0 commit comments