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
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [Unreleased]

### Added
- added Delegate Resignation Builder and Tests ([#207])

## [1.0.0] - 2020-02-13

### Changed
Expand Down Expand Up @@ -129,3 +134,5 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
[#190]: https://github.com/ArkEcosystem/cpp-crypto/pull/190
[#198]: https://github.com/ArkEcosystem/cpp-crypto/pull/198
[1.0.0]: https://github.com/ArkEcosystem/cpp-crypto/compare/0.7.0...1.0.0
[#207]: https://github.com/ArkEcosystem/cpp-crypto/pull/207
[unreleased]: https://github.com/ArkEcosystem/cpp-crypto/compare/1.0.0...develop
1 change: 1 addition & 0 deletions src/include/cpp-crypto/transactions/builders/builder.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
// #include "transactions/builders/multi_signature.hpp"
#include "transactions/builders/ipfs.hpp"
#include "transactions/builders/multi_payment.hpp"
#include "transactions/builders/delegate_resignation.hpp"
#include "transactions/builders/htlc_lock.hpp"
#include "transactions/builders/htlc_claim.hpp"
#include "transactions/builders/htlc_refund.hpp"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/**
* This file is part of Ark Cpp Crypto.
*
* (c) Ark Ecosystem <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
**/

#ifndef ARK_TRANSACTIONS_BUILDERS_DELEGATE_RESIGNATION_HPP
#define ARK_TRANSACTIONS_BUILDERS_DELEGATE_RESIGNATION_HPP

#include "transactions/builders/common.hpp"

namespace Ark {
namespace Crypto {
namespace transactions {
namespace builder {

////////////////////////////////////////////////////////////////////////////////
// Forward Declaration
class DelegateResignation;

////////////////////////////////////////////////////////////////////////////////
class DelegateResignation : public Common<DelegateResignation> {
public:
DelegateResignation() {
this->transaction.data.type = DELEGATE_RESIGNATION_TYPE;
}
};

} // namespace builder
} // namespace transactions
} // namespace Crypto
} // namespace Ark

#endif
1 change: 1 addition & 0 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ set(TRANSACTIONS_BUILDERS_TEST_SOURCE
${PROJECT_SOURCE_DIR}/transactions/builders/vote.cpp
${PROJECT_SOURCE_DIR}/transactions/builders/ipfs.cpp
${PROJECT_SOURCE_DIR}/transactions/builders/multi_payment.cpp
${PROJECT_SOURCE_DIR}/transactions/builders/delegate_resignation.cpp
${PROJECT_SOURCE_DIR}/transactions/builders/htlc_lock.cpp
${PROJECT_SOURCE_DIR}/transactions/builders/htlc_claim.cpp
${PROJECT_SOURCE_DIR}/transactions/builders/htlc_refund.cpp
Expand Down
34 changes: 34 additions & 0 deletions test/transactions/builders/delegate_resignation.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/**
* This file is part of Ark Cpp Crypto.
*
* (c) Ark Ecosystem <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
**/

#include "gtest/gtest.h"

#include "transactions/builders/delegate_resignation.hpp"

#include "interfaces/constants.h"

#include "fixtures/identity.hpp"
#include "transactions/types/fixtures/delegate_registration.hpp"

#include "test_helpers.h"

using namespace Ark::Crypto;
using namespace Ark::Crypto::transactions;

////////////////////////////////////////////////////////////////////////////////
TEST(transactions_builders, delegate_resignation) {
auto transaction = builder::DelegateResignation()
.nonce(COMMON_NONCE)
.senderPublicKey(fixtures::PublicKeyBytes.data())
.fee(TYPE_2_FEE)
.sign(fixtures::Passphrase)
.build();

ASSERT_TRUE(transaction.verify());
}