rpc.go
func (r rpc) simulateRequest(endpoint string, method string) ([]byte, error) {
	// Test files conform to replacing '/' in endpoint with '_'
	fileName := strings.Replace(endpoint, "/", "_", -1)
	// file names also have method type prepended to ensure uniqueness
	filePath := basePath + "/test_data/" + method + "_" + fileName + ".json"
	data, err := ioutil.ReadFile(filePath)
	if err != nil {
		return nil, err
	}
	return data, nil
}
func (r rpc) simulateRequest(endpoint string, method string) ([]byte, error) {
	// Test files conform to replacing '/' in endpoint with '_'
	fileName := strings.Replace(endpoint, "/", "_", -1)
	// file names also have method type prepended to ensure uniqueness
	filePath := basePath + "/test_data/" + method + "_" + fileName + ".json"
	data, err := ioutil.ReadFile(filePath)
	if err != nil {
		return nil, err
	}
	return data, nil
}
func ( r rpc ) simulateRequest ( endpoint string , method string ) ( [ ] byte , error ) { // Test files conform to replacing '/' in endpoint with '_' fileName := strings . Replace ( endpoint , " " , " " , - 1 ) // file names also have method type prepended to ensure uniqueness filePath := basePath + " " + method + " " + fileName + " " data , err := ioutil . ReadFile ( filePath ) if err != nil { return nil , err } return data , nil }
// simulateRequest simulates a request by returning a sample JSON from file
simulateRequest simulates a request by returning a sample JSON from file