fixes #114 allows to update the end date of a proposal
testable with the unit tests, otherwise testable by updating hive-js: hive-js!25 (merged)
then
create_account "initminer" "howo" "" true
transfer_to_vesting "initminer" "howo" "10000.000 TESTS" true
post_comment howo "test" "" "tag" "title" "body" "" true
transfer initminer howo "2500.000 TBD" "" true
create_proposal howo howo "2020-05-22T03:00:00" "2021-05-28T04:00:00" "200.000 TBD" "cool proposal vote me" "test" true
find_proposals [0]
the above should output:
[{
"id": 0,
"proposal_id": 0,
"creator": "howo",
"receiver": "howo",
"start_date": "2020-05-21T03:00:00",
"end_date": "2021-05-21T03:00:00",
"daily_pay": "200.000 TBD",
"subject": "cool proposal vote me",
"permlink": "test",
"total_votes": 0
}
]
then
const hive = require('@hiveio/hive-js');
hive.api.setOptions({url: 'http://127.0.0.1:8090', useAppbaseApi : true, address_prefix : 'TST', 'chain_id' : '18dcf0a285365fc58b71f18b3d3fec954aa0c141c44e4e5cb4cf777b9eab274e'});
function broadcast(tx, wif)
{
return new Promise(resolve => {
hive.broadcast.send(tx, {wif}, async function (err, result) {
if (err !== null) {
console.error(err)
return resolve(false)
} else {
return resolve(true)
}
});
});
}
async function test() {
let operations = [];
const extensions = [[0, {
"end_date": '2021-03-28T04:00:00'
}]];
operations.push(
[
'update_proposal', {
proposal_id: 0,
creator: 'howo',
daily_pay: '100.000 TBD',
subject: 'aaaaaaaa',
permlink: 'test',
extensions: extensions
}
]
)
tx = {
'operations': operations
};
await broadcast(tx, "activekey");
}
test()
[{
"id": 0,
"proposal_id": 0,
"creator": "howo",
"receiver": "howo",
"start_date": "2020-05-22T03:00:00",
"end_date": "2021-04-28T04:00:00",
"daily_pay": "100.000 TBD",
"subject": "aaaaaaaa",
"permlink": "test",
"total_votes": 0
}
]
get_account_history howo 100 100
# BLOCK # TRX ID OPERATION DETAILS
-------------------------------------------------------------------------------
0 7 963f9e8f0777f2c3da06979ac1cca8de88847f1f account_create {"fee":"0.000 TESTS","creator":"initminer","new_account_name":"howo","owner":{"weight_threshold":1,"account_auths":[],"key_auths":[["TST6iUpyUHY2HSLeYDLBXEAruyz8TadEoiAx1twfrXzSJM5EjQQat",1]]},"active":{"weight_threshold":1,"account_auths":[],"key_auths":[["TST5MVgTtJbyeVABZ4djTxThadDzjjWm8GWsv1BaFiEZKN7xkN1EY",1]]},"posting":{"weight_threshold":1,"account_auths":[],"key_auths":[["TST8cMFSWRxzw5RhaxjkZWxWwyyvCgHCJkZLY9bSvvFjotYYg4dF7",1]]},"memo_key":"TST7y4bMuamtz7G577XJofHbJq76F4bpBsCr1S8JZdweDjeuaLSeL","json_metadata":""}
1 8 ced733f86e09b208e1ae730487b49930d322ad6d transfer_to_vesting {"from":"initminer","to":"howo","amount":"10000.000 TESTS"}
2 9 df901fd801d76ba06b0f9a2614363c64b236bb89 comment {"parent_author":"","parent_permlink":"tag","author":"howo","permlink":"test","title":"title","body":"body","json_metadata":""}
3 10 82cbec421c7e82a10b855d61056613f911e76cc7 transfer {"from":"initminer","to":"howo","amount":"2500.000 TBD","memo":""}
4 11 f4bb099b401c17aa3901ee4ab2f1b277bd060eb6 create_proposal {"creator":"howo","receiver":"howo","start_date":"2020-05-22T03:00:00","end_date":"2021-05-28T04:00:00","daily_pay":"200.000 TBD","subject":"cool proposal vote me","permlink":"test"}
5 18 e5bc1133f252b65e0f84115c70e0f63c6abc3920 update_proposal {"proposal_id":0,"creator":"howo","daily_pay":"100.000 TBD","subject":"aaaaaaaa","permlink":"test","extensions":[[0,{"end_date":"2021-04-28T04:00:00"}]]}
{"creator":"howo","receiver":"howo","start_date":"2020-05-22T03:00:00","end_date":"2021-05-28T04:00:00","daily_pay":"200.000 TBD","subject":"cool proposal vote me","permlink":"test"}
5 31 646f040f4043031c6febb30fe9e842abf82eb12f update_proposal {"proposal_id":0,"creator":"howo","daily_pay":"100.000 TBD","subject":"cool proposal","permlink":"test","end_date":"2021-04-28T04:00:00"}
Edited by Howo
Merge request reports
Activity
added Review label
added 1 commit
- 82d0665e - add a has_hardfork to prevent people from updating the end date before hf25
- Resolved by Howo
added 2 commits
mentioned in commit hive-js@a90bfa5c
mentioned in merge request hive-js!25 (merged)
- Resolved by Howo
- Resolved by Howo
- Resolved by Howo
- Resolved by Howo
- Resolved by Howo
removed Review label
added Doing label
- Resolved by Howo
- Resolved by Howo
added 118 commits
-
bcc8507c...409e08ba - 109 commits from branch
develop
- 35660ba9 - fixes #114 (closed) allows to update the end date of a proposal
- 32c86ccb - add a has_hardfork to prevent people from updating the end date before hf25
- 42d1966c - cleaner hf25 version
- c151053e - fix beem tests
- 6e591c55 - work towards extensions
- 1dce0bb1 - finished ext rework
- 7131bea0 - fixes following review
- c1773172 - small review fixes from abit
- 4b98c087 - small code simplification
Toggle commit list-
bcc8507c...409e08ba - 109 commits from branch
added 14 commits
-
c0a38085...eab183f7 - 3 commits from branch
develop
- e1cdd48f - fixes #114 (closed) allows to update the end date of a proposal
- 5bb954df - add a has_hardfork to prevent people from updating the end date before hf25
- 430a2c95 - cleaner hf25 version
- 76bc0f35 - fix beem tests
- 5aa400f9 - work towards extensions
- d71e7a4a - finished ext rework
- c6d18959 - fixes following review
- 0c5f7523 - small review fixes from abit
- 49bbf713 - small code simplification
- 1babc3b5 - fix rebase issue
- 09df3b6b - fix compilation issue
Toggle commit list-
c0a38085...eab183f7 - 3 commits from branch
added 12 commits
- 9fc2f36b - fixes #114 (closed) allows to update the end date of a proposal
- fab825b0 - add a has_hardfork to prevent people from updating the end date before hf25
- 1bda13e9 - cleaner hf25 version
- 11e21f97 - fix beem tests
- 8e8c6036 - work towards extensions
- f1a388ea - finished ext rework
- 904771de - fixes following review
- d9df86fd - small review fixes from abit
- 027bac4f - small code simplification
- 041a9a42 - fix rebase issue
- 06b439ba - fix compilation issue
- bd0e8c18 - test beem update proposal
Toggle commit list- Resolved by Bartek Wrona
- Resolved by Bartek Wrona
- Resolved by Howo
- Resolved by Howo
added To Do label
added 3 commits
Please register or sign in to reply