Skip to content

Commit 589f358

Browse files
authored
Merge pull request #15 from JoyStream/development
dev to master - v0.3.0
2 parents a17b1e0 + d56c2a7 commit 589f358

8 files changed

Lines changed: 18 additions & 9 deletions

File tree

conan_package/base.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33

44
class ProtocolStateMachineBase(ConanFile):
55
name = "ProtocolStateMachine"
6-
version = "0.2.0"
6+
version = "0.3.0"
77
license = "(c) JoyStream Inc. 2016-2017"
88
url = "https://github.com/JoyStream/protocol_statemachine-cpp.git"
99
repo_ssh_url = "git@github.com:JoyStream/protocol_statemachine-cpp.git"
1010
repo_https_url = "https://github.com/JoyStream/protocol_statemachine-cpp.git"
1111
settings = "os", "compiler", "build_type", "arch"
1212
generators = "cmake"
13-
requires = "ProtocolWire/0.1.2@joystream/stable", "PaymentChannel/0.1.2@joystream/stable",
13+
requires = "ProtocolWire/0.1.2@joystream/stable", "PaymentChannel/0.2.0@joystream/stable", "Common/0.2.0@joystream/stable"
1414
build_policy = "missing"
1515

1616
def source(self):
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ class ProtocolStateMachineRelease(ProtocolStateMachineBase):
1111

1212
exports_sources = "../sources*"
1313

14+
build_policy="always"
15+
1416
def source(self):
1517
os.mkdir("repo")
1618
shutil.move("sources", "repo/")

sources/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.1 FATAL_ERROR)
22

33
project(ProtocoStateMachine CXX)
44

5-
add_definitions(-DMAJOR_PROTOCOL_VERSION=2)
5+
add_definitions(-DMAJOR_PROTOCOL_VERSION=3)
66
add_definitions(-DMINOR_PROTOCOL_VERSION=0)
77

88
option(build_tests "build tests" OFF)

sources/include/protocol_statemachine/CBStateMachine.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,8 @@ namespace protocol_statemachine {
140140
const ReceivedFullPiece &,
141141
const MessageOverflow &,
142142
const MessageOverflow &,
143-
int);
143+
int,
144+
Coin::Network network);
144145

145146
void processEvent(const sc::event_base &);
146147

sources/src/CBStateMachine.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ namespace protocol_statemachine {
3131
const ReceivedFullPiece & receivedFullPiece,
3232
const MessageOverflow & remoteMessageOverflow,
3333
const MessageOverflow & localMessageOverflow,
34-
int MAX_PIECE_INDEX)
34+
int MAX_PIECE_INDEX,
35+
Coin::Network network)
3536
: _currentlyProcessingCallbacks(false)
3637
, _peerAnnouncedMode(_queuedCallbacks, peerAnnouncedMode)
3738
, _invitedToOutdatedContract(_queuedCallbacks, invitedToOutdatedContract)
@@ -57,7 +58,9 @@ namespace protocol_statemachine {
5758
, _remoteMessageOverflow(_queuedCallbacks, remoteMessageOverflow)
5859
, _localMessageOverflow(_queuedCallbacks, localMessageOverflow)
5960
, _MAX_PIECE_INDEX(MAX_PIECE_INDEX)
60-
, _lastRequestedPiece(0) {
61+
, _lastRequestedPiece(0)
62+
, _payor(network)
63+
, _payee(network) {
6164
}
6265

6366
void CBStateMachine::processEvent(const sc::event_base & e) {

sources/test/BuyingNavigator.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ bool BuyingNavigator::Fixture::validatePayment(const Coin::Signature & payment,
2121
joiningContract.message().finalPkHash(),
2222
contractPrepared.contractKeyPair().pk(),
2323
contractPrepared.finalPkHash(),
24-
Coin::Signature());
24+
Coin::Signature(),
25+
Coin::Network::mainnet);
2526

2627
return payee.registerPayment(payment);
2728
}

sources/test/CBStateMachineCallbackSpy.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,8 @@ protocol_statemachine::CBStateMachine * CBStateMachineCallbackSpy::createMonitor
131131
[this](){
132132
_localMessageOverflow = true;
133133
},
134-
MAX_PIECE_INDEX);
134+
MAX_PIECE_INDEX,
135+
Coin::Network::mainnet);
135136

136137
// Initiate machine
137138
machine->initiate();

sources/test/SellingNavigator.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ event::Recv<protocol_wire::Payment> SellingNavigator::Fixture::goodPayment(const
1818
Coin::KeyPair(payorContractSk),
1919
contractReady.message().finalPkHash(),
2020
joinedContract.contractKeys().pk(),
21-
joinedContract.finalPkHash());
21+
joinedContract.finalPkHash(),
22+
Coin::Network::mainnet);
2223

2324
Coin::Signature payment = payor.generatePayorSettlementSignature();
2425

0 commit comments

Comments
 (0)