Skip to content
This repository has been archived by the owner on Nov 30, 2021. It is now read-only.

there are format errors in String() of ResultData #732

Closed
RevelationOfTuring opened this issue Jan 20, 2021 · 0 comments · Fixed by #733
Closed

there are format errors in String() of ResultData #732

RevelationOfTuring opened this issue Jan 20, 2021 · 0 comments · Fixed by #733

Comments

@RevelationOfTuring
Copy link

System info: [Include Ethermint commit, operating system name, and other relevant details]
there are format errors in String() of ResultData. The result of MsgEthermint.String() will show the pointer of ethtypes.Log as the member in the slice.

func (rd ResultData) String() string {
	return strings.TrimSpace(fmt.Sprintf(`ResultData:
	ContractAddress: %s
	Bloom: %s
        // convert pointers of ethtypes.Log into string
	Logs: %v
	Ret: %v
	TxHash: %s
`, rd.ContractAddress.String(), rd.Bloom.Big().String(), rd.Logs, rd.Ret, rd.TxHash.String()))
}

Steps to reproduce:

Print the result of the above function:

ResultData:
	ContractAddress: 0x5dE8a020088a2D6d0a23c204FFbeD02790466B49
	Bloom: 259
	Logs: [0xc00011c4d0] // pointer
	Ret: [5 8]
	TxHash: 0x0000000000000000000000000000000000000000000000000000000000000000
  1. [First Step]
  2. [Second Step]
  3. [and so on...]

Expected behavior: [What you expected to happen]
ResultData.Logs should be converted into string with the value of them instead of the pointers.
Actual behavior: [What actually happened]

Additional info: [Include gist of relevant config, logs, etc.]

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant