// Decode the data of ethOnBlock of GetReserves()
Decode the data of ethOnBlock of GetReserves()
// Decode the data of ethOnBlock of GetReserves ()
func DecodeReturnedDataOfGetReserves(pair common.Address, hexStr string, blockNumber int64) (*pojo.PairReserve, error) {
	bytes, err := hex.DecodeString(hexStr[2:])
	if err != nil {
		return nil, err
	}
	pairReserve := &pojo.PairReserve{
		Pair:               pair,
		Reserve0:           pojo.NewBigInt(big.NewInt(0).SetBytes(bytes[0:32])),
		Reserve1:           pojo.NewBigInt(big.NewInt(0).SetBytes(bytes[32:64])),
		BlockTimestampLast: uint32(big.NewInt(0).SetBytes(bytes[64:]).Int64()),
		BlockNumber:        blockNumber,
	}
	return pairReserve, nil
}
func DecodeReturnedDataOfGetReserves ( pair common . Address , hexStr string , blockNumber int64 ) ( * pojo . PairReserve , error ) { bytes , err := hex . DecodeString ( hexStr [ 2 : ] ) if err != nil { return nil , err } pairReserve := & pojo . PairReserve { Pair : pair , Reserve0 : pojo . NewBigInt ( big . NewInt ( 0 ) . SetBytes ( bytes [ 0 : 32 ] ) ) , Reserve1 : pojo . NewBigInt ( big . NewInt ( 0 ) . SetBytes ( bytes [ 32 : 64 ] ) ) , BlockTimestampLast : uint32 ( big . NewInt ( 0 ) . SetBytes ( bytes [ 64 : ] ) . Int64 ( ) ) , BlockNumber : blockNumber , } return pairReserve , nil }
Decode the data of ethOnBlock of GetReserves()
Decode the data of ethOnBlock of GetReserves ()