mirror of
https://github.com/EvernodeXRPL/sashimono.git
synced 2026-04-29 15:38:00 +00:00
Added contract id to the instance create message (#19)
This commit is contained in:
@@ -109,6 +109,7 @@ namespace msg::json
|
||||
* {
|
||||
* "type": "create",
|
||||
* "owner_pubkey": "<pubkey of the owner>"
|
||||
* "contract_id": "<contract id>"
|
||||
* }
|
||||
* @return 0 on successful extraction. -1 for failure.
|
||||
*/
|
||||
@@ -116,6 +117,20 @@ namespace msg::json
|
||||
{
|
||||
if (extract_commons(msg.type, msg.id, msg.pubkey, d) == -1)
|
||||
return -1;
|
||||
|
||||
if (!d.contains(msg::FLD_CONTRACT_ID))
|
||||
{
|
||||
LOG_ERROR << "Field contract_id is missing.";
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (!d[msg::FLD_CONTRACT_ID].is<std::string>())
|
||||
{
|
||||
LOG_ERROR << "Invalid contract_id value.";
|
||||
return -1;
|
||||
}
|
||||
|
||||
msg.contract_id = d[msg::FLD_CONTRACT_ID].as<std::string>();
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user