Loading...
Searching...
No Matches
contract_client.h
Go to the documentation of this file.
1/*
2 * Licensed to the Apache Software Foundation (ASF) under one
3 * or more contributor license agreements. See the NOTICE file
4 * distributed with this work for additional information
5 * regarding copyright ownership. The ASF licenses this file
6 * to you under the Apache License, Version 2.0 (the
7 * "License"); you may not use this file except in compliance
8 * with the License. You may obtain a copy of the License at
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing,
13 * software distributed under the License is distributed on an
14 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 * KIND, either express or implied. See the License for the
16 * specific language governing permissions and limitations
17 * under the License.
18 */
19
20#pragma once
21
23#include "proto/contract/account.pb.h"
24#include "proto/contract/contract.pb.h"
25
26namespace resdb {
27namespace contract {
28
29// ContractClient to send data to the contract server.
31 public:
32 ContractClient(const ResDBConfig& config);
33
34 absl::StatusOr<Account> CreateAccount();
35 absl::StatusOr<Contract> DeployContract(
36 const std::string& caller_address, const std::string& contract_name,
37 const std::string& contract_path,
38 const std::vector<std::string>& init_params);
39
40 absl::StatusOr<std::string> ExecuteContract(
41 const std::string& caller_address, const std::string& contract_address,
42 const std::string& func_name,
43 const std::vector<std::string>& func_params);
44};
45
46} // namespace contract
47} // namespace resdb
absl::StatusOr< Account > CreateAccount()
absl::StatusOr< std::string > ExecuteContract(const std::string &caller_address, const std::string &contract_address, const std::string &func_name, const std::vector< std::string > &func_params)
absl::StatusOr< Contract > DeployContract(const std::string &caller_address, const std::string &contract_name, const std::string &contract_path, const std::vector< std::string > &init_params)