Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

Fix contract::get_datastream() accessor #416

Merged
merged 1 commit into from
Feb 11, 2019
Merged
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
15 changes: 11 additions & 4 deletions libraries/eosiolib/contracts/eosio/contract.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class contract {
* Construct a new contract given the contract name
*
* @param self - The name of the account this contract is deployed on
* @param first_receiver - The account the incoming action was first received at.
* @param first_receiver - The account the incoming action was first received at.
* @param ds - The datastream used
*/
contract( name self, name first_receiver, datastream<const char*> ds ):_self(self),_first_receiver(first_receiver),_ds(ds) {}
Expand All @@ -52,7 +52,7 @@ class contract {
inline name get_code()const { return _first_receiver; }

/**
* The account the incoming action was first received at.
* The account the incoming action was first received at.
*
* @return name - The first_receiver name of the action this contract is processing.
*/
Expand All @@ -63,7 +63,14 @@ class contract {
*
* @return datastream<const char*> - The datastream for this contract
*/
inline datastream<const char*> get_datastream()const { return _ds; }
inline datastream<const char*>& get_datastream() { return _ds; }

/**
* Get the datastream for this contract
*
* @return datastream<const char*> - The datastream for this contract
*/
inline const datastream<const char*>& get_datastream()const { return _ds; }

protected:
/**
Expand All @@ -72,7 +79,7 @@ class contract {
name _self;

/**
* The account the incoming action was first received at.
* The account the incoming action was first received at.
*/
name _first_receiver;

Expand Down