Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/Qubic.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
<ClInclude Include="contracts\QIP.h" />
<ClInclude Include="contracts\QReservePool.h" />
<ClInclude Include="contracts\QThirtyFour.h" />
<ClInclude Include="contracts\Pulse.h" />
<ClInclude Include="contracts\TestExampleA.h" />
<ClInclude Include="contracts\TestExampleB.h" />
<ClInclude Include="contracts\TestExampleC.h" />
Expand Down
3 changes: 3 additions & 0 deletions src/Qubic.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,9 @@
<ClInclude Include="contracts\QDuel.h">
<Filter>contracts</Filter>
</ClInclude>
<ClInclude Include="contracts\Pulse.h">
<Filter>contracts</Filter>
</ClInclude>
<ClInclude Include="contract_core\pre_qpi_def.h">
<Filter>contract_core</Filter>
</ClInclude>
Expand Down
20 changes: 20 additions & 0 deletions src/contract_core/contract_def.h
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,20 @@
#define CONTRACT_STATE2_TYPE QDUEL2
#include "contracts/QDuel.h"

#ifndef NO_PULSE

#undef CONTRACT_INDEX
#undef CONTRACT_STATE_TYPE
#undef CONTRACT_STATE2_TYPE

#define PULSE_CONTRACT_INDEX 24
#define CONTRACT_INDEX PULSE_CONTRACT_INDEX
#define CONTRACT_STATE_TYPE PULSE
#define CONTRACT_STATE2_TYPE PULSE2
#include "contracts/Pulse.h"

#endif

// new contracts should be added above this line

#ifdef INCLUDE_CONTRACT_TEST_EXAMPLES
Expand Down Expand Up @@ -355,6 +369,9 @@ constexpr struct ContractDescription
{"QRP", 199, 10000, sizeof(IPO)}, // proposal in epoch 197, IPO in 198, construction and first use in 199
{"QTF", 199, 10000, sizeof(QTF)}, // proposal in epoch 197, IPO in 198, construction and first use in 199
{"QDUEL", 199, 10000, sizeof(QDUEL)}, // proposal in epoch 197, IPO in 198, construction and first use in 199
#ifndef NO_PULSE
{"PULSE", 204, 10000, sizeof(PULSE)}, // proposal in epoch 202, IPO in 203, construction and first use in 204
#endif
// new contracts should be added above this line
#ifdef INCLUDE_CONTRACT_TEST_EXAMPLES
{"TESTEXA", 138, 10000, sizeof(TESTEXA)},
Expand Down Expand Up @@ -474,6 +491,9 @@ static void initializeContracts()
REGISTER_CONTRACT_FUNCTIONS_AND_PROCEDURES(QRP);
REGISTER_CONTRACT_FUNCTIONS_AND_PROCEDURES(QTF);
REGISTER_CONTRACT_FUNCTIONS_AND_PROCEDURES(QDUEL);
#ifndef NO_PULSE
REGISTER_CONTRACT_FUNCTIONS_AND_PROCEDURES(PULSE);
#endif
// new contracts should be added above this line
#ifdef INCLUDE_CONTRACT_TEST_EXAMPLES
REGISTER_CONTRACT_FUNCTIONS_AND_PROCEDURES(TESTEXA);
Expand Down
2 changes: 2 additions & 0 deletions src/contract_core/ipo.h
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,8 @@ static void finishIPOs()
if (finalPrice > 0)
{
setContractFeeReserve(contractIndex, finalPrice * NUMBER_OF_COMPUTORS);
// IPO finished successfully, mark this contract error as NoContractError
contractError[contractIndex] = NoContractError;
}
else
{
Expand Down
Loading
Loading