mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2024-12-25 12:57:18 +00:00
05678b6724
* discoveryV5.1 * add seed node * fix up * checkpoint * Add workaround for discv5.1 signature curve. Add discv5.1 catdog ENR * remove dead code * Add another catdog * Fix bootnode * fix docker img Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com> Co-authored-by: Preston Van Loon <preston@prysmaticlabs.com>
25 lines
824 B
Go
25 lines
824 B
Go
package depositcontract
|
|
|
|
import (
|
|
"bytes"
|
|
|
|
"github.com/ethereum/go-ethereum/accounts/abi"
|
|
"github.com/pkg/errors"
|
|
)
|
|
|
|
// UnpackDepositLogData unpacks the data from a deposit log using the ABI decoder.
|
|
func UnpackDepositLogData(data []byte) (pubkey, withdrawalCredentials, amount, signature, index []byte, err error) {
|
|
reader := bytes.NewReader([]byte(DepositContractABI))
|
|
contractAbi, err := abi.JSON(reader)
|
|
if err != nil {
|
|
return nil, nil, nil, nil, nil, errors.Wrap(err, "unable to generate contract abi")
|
|
}
|
|
|
|
unpackedLogs, err := contractAbi.Unpack("DepositEvent", data)
|
|
if err != nil {
|
|
return nil, nil, nil, nil, nil, errors.Wrap(err, "unable to unpack logs")
|
|
}
|
|
|
|
return unpackedLogs[0].([]byte), unpackedLogs[1].([]byte), unpackedLogs[2].([]byte), unpackedLogs[3].([]byte), unpackedLogs[4].([]byte), nil
|
|
}
|