forked from OrchidTechnologies/orchid
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Watch lottery pots to verify client has the money.
- Loading branch information
Showing
32 changed files
with
471 additions
and
129 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -171,7 +171,7 @@ class Base { | |
}; | ||
|
||
class Association : | ||
public Pump, | ||
public Pump<Buffer>, | ||
public Base | ||
{ | ||
protected: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/* Orchid - WebRTC P2P VPN Market (on Ethereum) | ||
* Copyright (C) 2017-2019 The Orchid Authors | ||
*/ | ||
|
||
/* GNU Affero General Public License, Version 3 {{{ */ | ||
/* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU Affero General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU Affero General Public License for more details. | ||
* You should have received a copy of the GNU Affero General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
**/ | ||
/* }}} */ | ||
|
||
|
||
#include "station.hpp" | ||
|
||
namespace orc { | ||
|
||
void Station::Land(Json::Value data) { | ||
orc_assert(data["jsonrpc"] == "2.0"); | ||
return Outer()->Land(std::move(data)); | ||
} | ||
|
||
task<void> Station::Send(const std::string &method, const std::string &id, Argument args) { | ||
Json::Value root; | ||
root["jsonrpc"] = "2.0"; | ||
root["method"] = method; | ||
root["id"] = id; | ||
root["params"] = std::move(args); | ||
co_await Inner()->Send(root); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
/* Orchid - WebRTC P2P VPN Market (on Ethereum) | ||
* Copyright (C) 2017-2019 The Orchid Authors | ||
*/ | ||
|
||
/* GNU Affero General Public License, Version 3 {{{ */ | ||
/* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU Affero General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU Affero General Public License for more details. | ||
* You should have received a copy of the GNU Affero General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
**/ | ||
/* }}} */ | ||
|
||
|
||
#ifndef ORCHID_STATION_HPP | ||
#define ORCHID_STATION_HPP | ||
|
||
#include "jsonrpc.hpp" | ||
#include "link.hpp" | ||
|
||
namespace orc { | ||
|
||
class Station : | ||
public Faucet<Drain<Json::Value>>, | ||
public Drain<Json::Value> | ||
{ | ||
protected: | ||
virtual Pump<Json::Value, Json::Value> *Inner() = 0; | ||
|
||
void Land(Json::Value data) override; | ||
|
||
void Stop(const std::string &error) override { | ||
return Faucet<Drain<Json::Value>>::Stop(error); | ||
} | ||
|
||
public: | ||
Station(Drain<Json::Value> *drain) : | ||
Faucet<Drain<Json::Value>>(drain) | ||
{ | ||
} | ||
|
||
task<void> Send(const std::string &method, const std::string &id, Argument args); | ||
}; | ||
|
||
} | ||
|
||
#endif//ORCHID_STATION_HPP |
Oops, something went wrong.