update parseTopicsIntoMap to handle strings
This commit is contained in:
parent
8bd397e2eb
commit
ac93139863
@ -41,7 +41,8 @@ In order to install packages with `dep`, ensure you are in the project directory
|
|||||||
|
|
||||||
After `dep` finishes, dependencies should be installed within your `GOPATH` at the versions specified in `Gopkg.toml`.
|
After `dep` finishes, dependencies should be installed within your `GOPATH` at the versions specified in `Gopkg.toml`.
|
||||||
|
|
||||||
Because we are working with a modified version of the go-ethereum accounts/abi package, after running `dep ensure` you will need to run `git checkout vendor/github/ethereum/go-ethereum/accounts/abi` to checkout the modified dependency
|
Because we are working with a modified version of the go-ethereum accounts/abi package, after running `dep ensure` you will need to run `git checkout vendor/github/ethereum/go-ethereum/accounts/abi` to checkout the modified dependency.
|
||||||
|
This is explained in greater detail [here](https://github.com/vulcanize/maker-vulcanizedb/issues/41).
|
||||||
|
|
||||||
Lastly, ensure that `GOPATH` is defined in your shell. If necessary, `GOPATH` can be set in `~/.bashrc` or `~/.bash_profile`, depending upon your system. It can be additionally helpful to add `$GOPATH/bin` to your shell's `$PATH`.
|
Lastly, ensure that `GOPATH` is defined in your shell. If necessary, `GOPATH` can be set in `~/.bashrc` or `~/.bash_profile`, depending upon your system. It can be additionally helpful to add `$GOPATH/bin` to your shell's `$PATH`.
|
||||||
|
|
||||||
|
10
vendor/github.com/ethereum/go-ethereum/accounts/abi/bind/topics.go
generated
vendored
10
vendor/github.com/ethereum/go-ethereum/accounts/abi/bind/topics.go
generated
vendored
@ -218,6 +218,16 @@ func parseTopicsIntoMap(out map[string]interface{}, fields abi.Arguments, topics
|
|||||||
out[arg.Name] = topics[0]
|
out[arg.Name] = topics[0]
|
||||||
case abi.BytesTy, abi.FixedBytesTy:
|
case abi.BytesTy, abi.FixedBytesTy:
|
||||||
out[arg.Name] = topics[0][:]
|
out[arg.Name] = topics[0][:]
|
||||||
|
case abi.StringTy:
|
||||||
|
bytes := topics[0].Bytes()
|
||||||
|
var trimmedBytes []byte
|
||||||
|
for i, by := range bytes {
|
||||||
|
if by != 0 {
|
||||||
|
trimmedBytes = bytes[i:]
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
out[arg.Name] = string(trimmedBytes)
|
||||||
default:
|
default:
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user