diff --git a/README.md b/README.md index a45bc22..e319452 100644 --- a/README.md +++ b/README.md @@ -345,12 +345,13 @@ Create bounty - `{name} author_user_id` - author (EOSN Login ID) - `{name} bount_id` - bounty ID - `{symbol_code} accepted_token` - accepted deposit token (ex: `"USDT"`) +- `{string} url` - bounty URL (ex: GitHub issue URL) - `{optional} bounty_type` - bounty type (default = traditional) ### Example ```bash -$ cleos push action work.pomelo create '[author.eosn, bounty1, "USDT", null]' -p author.eosn +$ cleos push action work.pomelo create '[author.eosn, bounty1, "USDT", "https://github.com/pomelo-io/pomelo-rest-api/issues/735", null]' -p author.eosn ``` ## ACTION `setmetadata` diff --git a/work.pomelo.cpp b/work.pomelo.cpp index 9f9b829..85ad297 100644 --- a/work.pomelo.cpp +++ b/work.pomelo.cpp @@ -55,7 +55,7 @@ void pomelo::deltoken( const symbol_code symcode ) // @author [[eosio::action]] -void pomelo::create( const name author_user_id, const name bounty_id, const symbol_code accepted_token, const optional bounty_type ) +void pomelo::create( const name author_user_id, const name bounty_id, const symbol_code accepted_token, const string url, const optional bounty_type ) { eosn::login::require_auth_user_id( author_user_id, get_configs().login_contract ); @@ -84,6 +84,7 @@ void pomelo::create( const name author_user_id, const name bounty_id, const symb row.permissions = "approval"_n; row.created_at = current_time_point(); row.updated_at = current_time_point(); + row.metadata["url"_n] = url; }); pomelo::createlog_action createlog( get_self(), { get_self(), "active"_n }); createlog.send( bounty_id, author_user_id, extended_symbol{ token.sym, token.contract }, type, "approval"_n ); @@ -187,6 +188,7 @@ void pomelo::setconfig( const optional status, const optional fe if ( login_contract ) configs.login_contract = *login_contract; if ( fee_account ) configs.fee_account = *fee_account; if ( metadata_keys.size() ) configs.metadata_keys = metadata_keys; + configs.metadata_keys.insert("url"_n); // always include url by default _configs.set( configs, get_self() ); } diff --git a/work.pomelo.hpp b/work.pomelo.hpp index 2653ca0..b99237b 100644 --- a/work.pomelo.hpp +++ b/work.pomelo.hpp @@ -236,16 +236,17 @@ class [[eosio::contract("work.pomelo")]] pomelo : public eosio::contract { * - `{name} author_user_id` - author (EOSN Login ID) * - `{name} bount_id` - bounty ID * - `{symbol_code} accepted_token` - accepted deposit token (ex: `"USDT"`) + * - `{string} url` - bounty URL (ex: GitHub issue URL) * - `{optional} bounty_type` - bounty type (default = traditional) * * ### Example * * ```bash - * $ cleos push action work.pomelo create '[author.eosn, bounty1, "USDT", null]' -p author.eosn + * $ cleos push action work.pomelo create '[author.eosn, bounty1, "USDT", "https://github.com/pomelo-io/pomelo-rest-api/issues/735", null]' -p author.eosn * ``` */ [[eosio::action]] - void create( const name author_user_id, const name bounty_id, const symbol_code accepted_token, const optional bounty_type ); + void create( const name author_user_id, const name bounty_id, const symbol_code accepted_token, const string url, const optional bounty_type ); /** * ## ACTION `setstate`