Skip to content
Snippets Groups Projects
Commit 663912e7 authored by roadscape's avatar roadscape
Browse files

add missing op definitions - witness_set_properties and account_update2

parent b290d631
No related branches found
No related tags found
No related merge requests found
...@@ -51,23 +51,25 @@ ChainTypes.operations= { ...@@ -51,23 +51,25 @@ ChainTypes.operations= {
claim_reward_balance: 39, claim_reward_balance: 39,
delegate_vesting_shares: 40, delegate_vesting_shares: 40,
account_create_with_delegation: 41, account_create_with_delegation: 41,
create_proposal: 42, witness_set_properties: 42,
update_proposal_votes: 43, account_update2: 43,
remove_proposal: 44, create_proposal: 44,
fill_convert_request: 45, update_proposal_votes: 45,
author_reward: 46, remove_proposal: 46,
curation_reward: 47, fill_convert_request: 47,
comment_reward: 48, author_reward: 48,
liquidity_reward: 49, curation_reward: 49,
interest: 50, comment_reward: 50,
fill_vesting_withdraw: 51, liquidity_reward: 51,
fill_order: 52, interest: 52,
shutdown_witness: 53, fill_vesting_withdraw: 53,
fill_transfer_from_savings: 54, fill_order: 54,
hardfork: 55, shutdown_witness: 55,
comment_payout_update: 56, fill_transfer_from_savings: 56,
return_vesting_delegation: 57, hardfork: 57,
comment_benefactor_reward: 58 comment_payout_update: 58,
return_vesting_delegation: 59,
comment_benefactor_reward: 60
}; };
//types.hpp //types.hpp
......
...@@ -598,6 +598,26 @@ let account_create_with_delegation = new Serializer( ...@@ -598,6 +598,26 @@ let account_create_with_delegation = new Serializer(
} }
); );
let witness_set_properties = new Serializer(
"witness_set_properties", {
owner: string,
props: string,
extensions: set(future_extensions)
}
);
let account_update2 = new Serializer(
"account_update2", {
account: string,
owner: optional(authority),
active: optional(authority),
posting: optional(authority),
memo_key: public_key,
json_metadata: string,
extensions: set(future_extensions)
}
);
let create_proposal = new Serializer( let create_proposal = new Serializer(
"create_proposal", { "create_proposal", {
creator: string, creator: string,
...@@ -606,7 +626,8 @@ let create_proposal = new Serializer( ...@@ -606,7 +626,8 @@ let create_proposal = new Serializer(
end_date: time_point_sec, end_date: time_point_sec,
daily_pay: asset, daily_pay: asset,
subject: string, subject: string,
permlink: string permlink: string,
extensions: set(future_extensions)
} }
); );
...@@ -614,14 +635,16 @@ let update_proposal_votes = new Serializer( ...@@ -614,14 +635,16 @@ let update_proposal_votes = new Serializer(
"update_proposal_votes", { "update_proposal_votes", {
voter: string, voter: string,
proposal_ids: array(uint64), proposal_ids: array(uint64),
approve: bool approve: bool,
extensions: set(future_extensions)
} }
); );
let remove_proposal = new Serializer( let remove_proposal = new Serializer(
"remove_proposal", { "remove_proposal", {
proposal_owner: string, proposal_owner: string,
proposal_ids: array(uint64) proposal_ids: array(uint64),
extensions: set(future_extensions)
} }
); );
...@@ -781,6 +804,8 @@ operation.st_operations = [ ...@@ -781,6 +804,8 @@ operation.st_operations = [
claim_reward_balance, claim_reward_balance,
delegate_vesting_shares, delegate_vesting_shares,
account_create_with_delegation, account_create_with_delegation,
witness_set_properties,
account_update2,
create_proposal, create_proposal,
update_proposal_votes, update_proposal_votes,
remove_proposal, remove_proposal,
......
...@@ -431,6 +431,28 @@ module.exports = [ ...@@ -431,6 +431,28 @@ module.exports = [
"extensions" "extensions"
] ]
}, },
{
"roles": ["active", "owner"],
"operation": "witness_set_properties",
"params": [
"owner",
"props",
"extensions"
]
},
{
"roles": ["posting", "active", "owner"],
"operation": "account_update2",
"params": [
"account",
"owner",
"active",
"posting",
"memo_key",
"json_metadata",
"extensions"
]
},
{ {
"roles": ["active", "owner"], "roles": ["active", "owner"],
"operation": "create_proposal", "operation": "create_proposal",
...@@ -441,7 +463,8 @@ module.exports = [ ...@@ -441,7 +463,8 @@ module.exports = [
"end_date", "end_date",
"daily_pay", "daily_pay",
"subject", "subject",
"permlink" "permlink",
"extensions"
] ]
}, },
{ {
...@@ -450,7 +473,8 @@ module.exports = [ ...@@ -450,7 +473,8 @@ module.exports = [
"params": [ "params": [
"voter", "voter",
"proposal_ids", "proposal_ids",
"approve" "approve",
"extensions"
] ]
}, },
{ {
...@@ -458,7 +482,8 @@ module.exports = [ ...@@ -458,7 +482,8 @@ module.exports = [
"operation": "remove_proposal", "operation": "remove_proposal",
"params": [ "params": [
"proposal_owner", "proposal_owner",
"proposal_ids" "proposal_ids",
"extensions"
] ]
}, },
{ {
......
...@@ -20,8 +20,8 @@ describe('steem.hf21-accounts:', () => { ...@@ -20,8 +20,8 @@ describe('steem.hf21-accounts:', () => {
should.exist(steem.broadcast.removeProposalAsync); should.exist(steem.broadcast.removeProposalAsync);
}); });
describe('create proposal', () => { describe('create proposal ops', () => {
it('signs and verifies auth', function(done) { it('signs and verifies create_proposal', function(done) {
let permlink = 'test'; let permlink = 'test';
let tx = { let tx = {
...@@ -49,5 +49,24 @@ describe('steem.hf21-accounts:', () => { ...@@ -49,5 +49,24 @@ describe('steem.hf21-accounts:', () => {
}); });
}); });
}) })
it('signs and verifies update_proposal_votes', function(done) {
let tx = {
'operations': [[
'update_proposal_votes', {
'voter': username,
'proposal_ids': [7],
'approve': true
}]]
}
steem.broadcast._prepareTransaction(tx).then(function(tx){
tx = steem.auth.signTransaction(tx, [activeWif]);
steem.api.verifyAuthorityAsync(tx).then(
(result) => {result.should.equal(true); done();},
(err) => {done(err);}
);
});
})
}); });
}); });
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment