fix FormatLogs memory (#75)

This commit is contained in:
HAOYUatHZ 2022-04-02 11:25:07 +08:00 committed by GitHub
parent 3d3c9d3edf
commit 06190d0642
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -437,8 +437,7 @@ func FormatLogs(logs []StructLog) []types.StructLogRes {
if len(trace.Memory) != 0 { if len(trace.Memory) != 0 {
memory := make([]string, 0, (len(trace.Memory)+31)/32) memory := make([]string, 0, (len(trace.Memory)+31)/32)
for i := 0; i+32 <= len(trace.Memory); i += 32 { for i := 0; i+32 <= len(trace.Memory); i += 32 {
bytes := new(big.Int).SetBytes(trace.Memory[i : i+32]).Bytes() memory = append(memory, fmt.Sprintf("%x", trace.Memory[i:i+32]))
memory = append(memory, hexutil.Encode(bytes))
} }
formatted[index].Memory = &memory formatted[index].Memory = &memory
} }