Skip to content

Commit

Permalink
Merge branch 'staging' v0.8.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Vandeberg committed Jun 29, 2016
2 parents f566957 + b70ba94 commit 6cd230b
Show file tree
Hide file tree
Showing 7 changed files with 149 additions and 9 deletions.
37 changes: 37 additions & 0 deletions doc/git-guildelines.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
The git guidelines for Steemit are influenced by the [Graphene](https://github.com/cryptonomex/graphene/wiki/How-we-use-version-control) git guidelines as well as [Git Flow](http://nvie.com/posts/a-successful-git-branching-model/) and [this blog post](http://www.draconianoverlord.com/2013/09/07/no-cherry-picking.html).

### Branches

- `origin/master` : Contains releases of Steem. `origin/master` and `origin/HEAD` should always be at the most recent release. All witnesses should be running this branch.
- `origin/staging` : Staging branch for new releases. Release candidates of develop will be merged into staging for review. Witnesses wanting to run the latest builds and test new features and bug fixes should be on this branch.
- `origin/develop` : The development branch. Develop should always build but may contain bugs. This branch is only for developers.

### Patch Branches

All issues should be developed against their own branch. These branches should have the most recent staging branch as a working parent and then merged into develop when they are tested and ready to be deployed.
If an issue needs another issue as a dependency, branch from `staging`, merge the dependent issue branch into the new branch, and begin development. The naming scheme we use is the issue number, then a dash, followed by a shorthand description of the issue. For example, issue 22 is to allow the removal of an upvote. Branch `22-undo-vote` was used to devlop the patch for this issue.

### Non-Issue Branches

Some changes are so minor as to not require an issue, e.g. changes to logging. If in doubt, create an issue for the change and follow the guidelines above. Issues serve as documentation for many changes. These should still be done against `staging` where possible (or the earliest commit they depend on, where not possible) and merged into `develop`. In practice you may develop such patches against `master`; then rebase against `develop` before pushing.

##Policies

### Force-push policy

- `origin/master` should never be force pushed.
- `origin/staging` should rarely be force pushed. Exceptions to this policy may be made on a case-by-case basis.
- `origin/develop` should rarely be force pushed. It may be force-pushed to kill patches that are prematurely merged. Force pushing beyond this is likely an idication development should have occured on an issue branch.
- Individual patch branches may be force-pushed at any time, at the discretion of the developer or team working on the patch.

### Tagging Policy

- Tags are reserved for releases. The version scheme is `vMajor.Hardfork.Release` (Ex. v0.5.0 is the version for the Hardfork 5 release). Releases should be made only on `master`.

### Code review policy

- Two developers *must* review *every* consensus-breaking change before it moves into `graphene/master`.
- Two developers *should* review *every* patch before it moves into `graphene/master`.
- One of the reviewers may be the author of the change.
- This policy is designed to encourage you to take off your "writer hat" and put on your "critic/reviewer hat." If this was a patch from an unfamiliar community contributor, would you accept it? Can you understand what the patch does and check its correctness based only on its commit message and diff? Does it break any existing tests, or need new tests to be written? Is it stylistically sloppy -- trailing whitespace, multiple unrelated changes in a single patch, mixing bugfixes and features, or overly verbose debug logging?
- Having multiple people look at a patch reduces the probability it will contain bugs.
5 changes: 4 additions & 1 deletion libraries/chain/database.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1771,6 +1771,7 @@ void database::cashout_comment_helper( const comment_object& comment )
share_type author_tokens = reward_tokens.to_uint64() - discussion_tokens - curation_tokens;

author_tokens += pay_curators( comment, curation_tokens );

if( discussion_tokens > 0 )
author_tokens += pay_discussions( comment, discussion_tokens );

Expand Down Expand Up @@ -2054,10 +2055,12 @@ uint16_t database::get_activity_rewards_percent() const

uint16_t database::get_discussion_rewards_percent() const
{
/*
if( has_hardfork( STEEMIT_HARDFORK_0_8__116 ) )
return STEEMIT_1_PERCENT * 25;
else
return 0;
*/
return 0;
}

uint16_t database::get_curation_rewards_percent() const
Expand Down
2 changes: 1 addition & 1 deletion libraries/chain/include/steemit/chain/config.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*/
#pragma once

#define STEEMIT_BLOCKCHAIN_VERSION ( version(0, 8, 1) )
#define STEEMIT_BLOCKCHAIN_VERSION ( version(0, 8, 2) )
#define STEEMIT_BLOCKCHAIN_HARDFORK_VERSION ( hardfork_version( STEEMIT_BLOCKCHAIN_VERSION ) )

#ifdef IS_TEST_NET
Expand Down
2 changes: 1 addition & 1 deletion libraries/chain/steem_evaluator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -780,7 +780,7 @@ void vote_evaluator::do_apply( const vote_operation& o )
cv.vote_percent = o.weight;
cv.last_update = db().head_block_time();

if( rshares > 0 && comment.last_payout.sec_since_epoch() == 0 && comment.allow_curation_rewards )
if( rshares > 0 && (comment.last_payout == fc::time_point_sec()) && comment.allow_curation_rewards )
{
// cv.weight = W(R_1) - W(R_0)
if( db().has_hardfork( STEEMIT_HARDFORK_0_1 ) )
Expand Down
69 changes: 69 additions & 0 deletions libraries/sidechain/include/steemit/sidechain/sidechain.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
#pragma once

namespace steemit { namespace sidechain {
using std::string;

#define side_ids 10

typedef side_object_types {
side_account_type = 1,
pending_transaction_object = 2
};


/** This operation can be used for internal transfers and withdraw requests */
struct sidechain_transfer_operation {
string sidechain;
string from; /// must be in required active signatures
string to;
asset amount;
string memo;
};

/** This operation can be used for broadcasting signatures to apply to pending
* sidechain transactions.
*/
struct sidechain_sign_operation {
string sidechain;
string signer; ///< must be in required active signatures
transaction_id_type trx_id;
set<signature_type> signatures;
};

FC_REFLECT( sidechain_transfer_operation, (sidechain)(from)(to)(amount)(memo) )

class side_account_object : public abstract_object<side_account_object> {
public:
static const uint8_t space_id = side_ids;
static const uint8_t type_id = side_account_type;

string sidechain; ///< name of the sidechain account
string name; /// sub account within the side chain

asset steem_balance;
asset dollar_balance;
};

FC_REFLECT_DERIVED( steemit::sidechain::side_account, (graphene::db::object),
(sidechain)(name)(steem_balance)(dollar_balance)
);


/**
* This index maintains a database of transactions that are
*/
class pending_transaction_object : public abstract_object<pending_transaction_object> {
public:
static const uint8_t space_id = side_ids;
static const uint8_t type_id = side_account_type;

string sidechain; ///< name of the sidechain account
bool approved; ///< whether or not the transaction has been confirmed
time_point_sec expiration; ///< when the transaction expires
transaction_id_type trx_id;
signed_transaction trx;
};



} }
15 changes: 15 additions & 0 deletions libraries/wallet/include/steemit/wallet/wallet.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -582,6 +582,20 @@ class wallet_api
*/
annotated_signed_transaction withdraw_vesting( string from, asset vesting_shares, bool broadcast = false );

/**
* Set up a vesting withdraw route. When vesting shares are withdrawn, they will be routed to these accounts
* based on the specified weights.
*
* @param from The account the VESTS are withdrawn from.
* @param to The account receiving either VESTS or STEEM.
* @param percent The percent of the withdraw to go to the 'to' account. This is denoted in hundreths of a percent.
* i.e. 100 is 1% and 10000 is 100%. This value must be between 1 and 100000
* @param auto_vest Set to true if the from account should receive the VESTS as VESTS, or false if it should receive
* them as STEEM.
* @param broadcast true if you wish to broadcast the transaction.
*/
annotated_signed_transaction set_withdraw_vesting_route( string from, string to, uint16_t percent, bool auto_vest, bool broadcast = false );

/**
* This method will convert SBD to STEEM at the current_median_history price one
* week from the time it is executed. This method depends upon there being a valid price feed.
Expand Down Expand Up @@ -786,6 +800,7 @@ FC_API( steemit::wallet::wallet_api,
(transfer)
(transfer_to_vesting)
(withdraw_vesting)
(set_withdraw_vesting_route)
(convert_sbd)
(publish_feed)
(get_order_book)
Expand Down
28 changes: 22 additions & 6 deletions libraries/wallet/wallet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -773,12 +773,12 @@ class wallet_api_impl
ss << setiosflags( ios::fixed ) << setiosflags( ios::left ) ;

ss << ' ' << setw( ( spacing * 4 ) + 6 ) << "Bids" << "Asks\n"
<< ' '
<< ' '
<< setw( spacing + 3 ) << "Sum(SBD)"
<< setw( spacing + 1) << "SBD"
<< setw( spacing + 1) << "SBD"
<< setw( spacing + 1 ) << "STEEM"
<< setw( spacing + 1 ) << "Price"
<< setw( spacing + 1 ) << "Price"
<< setw( spacing + 1 ) << "Price"
<< setw( spacing + 1 ) << "Price"
<< setw( spacing + 1 ) << "STEEM "
<< setw( spacing + 1 ) << "SBD " << "Sum(SBD)"
<< "\n====================================================================================================="
Expand All @@ -789,7 +789,7 @@ class wallet_api_impl
if ( i < orders.bids.size() )
{
bid_sum += asset( orders.bids[i].sbd, SBD_SYMBOL );
ss
ss
<< ' ' << setw( spacing ) << bid_sum.to_string()
<< ' ' << setw( spacing ) << asset( orders.bids[i].sbd, SBD_SYMBOL ).to_string()
<< ' ' << setw( spacing ) << asset( orders.bids[i].steem, STEEM_SYMBOL ).to_string()
Expand Down Expand Up @@ -1626,6 +1626,22 @@ annotated_signed_transaction wallet_api::withdraw_vesting(string from, asset ves
return my->sign_transaction( tx, broadcast );
}

annotated_signed_transaction wallet_api::set_withdraw_vesting_route( string from, string to, uint16_t percent, bool auto_vest, bool broadcast )
{
FC_ASSERT( !is_locked() );
set_withdraw_vesting_route_operation op;
op.from_account = from;
op.to_account = to;
op.percent = percent;
op.auto_vest = auto_vest;

signed_transaction tx;
tx.operations.push_back( op );
tx.validate();

return my->sign_transaction( tx, broadcast );
}

annotated_signed_transaction wallet_api::convert_sbd(string from, asset amount, bool broadcast )
{
FC_ASSERT( !is_locked() );
Expand Down Expand Up @@ -1793,7 +1809,7 @@ annotated_signed_transaction wallet_api::follow( string follower, string followi
get_account( following.substr(1) );
}
FC_ASSERT( following.size() > 1 );

follow::follow_operation fop;
fop.follower = follower;
fop.following = following;
Expand Down

0 comments on commit 6cd230b

Please sign in to comment.