Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add new contract: personal.bos #66

Merged
merged 2 commits into from
Mar 27, 2019

Conversation

maodaishan
Copy link

add new contract: personal.bos

Change Description

add new contract: personal.bos , contains actions:
1.setpersonal
2.sethomepage
this contract has a table "personaldata" ,which's a key-value map to store customized public info for accounts. it has 2 columns:
key: the primary key
value: the value, should be less than 1024.
setpersonal:user can call to set the key-value they wish,and read it via get table.
sethomepage:the same with setpersonal, just the key is fixed to "homepage", by supplying homepage, dapp can easily guide user to their homepage.

with commits on "boscore/bos",user can also use "cleos set personal ..." and "cleos get account ..." to set personaldata and read homepage.
also add an inline interface "getpersonal" in personal.bos.hpp for easily accessing this multi-index for contracts.

Deployment Changes

  • Deployment Changes

when deploying,you need to create account "personal.bos" and set this contract to it to let it work.

API Changes

  • API Changes

abi change:
added new contract : personal.bos, with 2 actions:
1.setpersonal :
2.sethomepage :
and a table, named "personaldata", with columns:
key (name, the primary key)
value (string)
also add an inline interface "getpersonal" in personal.bos.hpp for easily accessing this multi-index for contracts.

Documentation Additions

  • Documentation Additions

none

1.setpersonal
2.sethomepage
this contract has a table "personaldata" ,which's a key-value map to store customized public info for accounts. it has 2 columns:
   key: the primary key
   value: the value, should be less than 1024.
setpersonal:user can call to set the key-value they wish,and read it via get table.
sethomepage:the same with setpersonal, just the key is fixed to "homepage", by supplying homepage, dapp can easily guide user to their homepage.

with commits on "boscore/bos",user can also use "cleos set personal ..." and "cleos get account ..." to set personaldata and read homepage.
also add an inline interface "getpersonal" in personal.bos.hpp for easily accessing this multi-index for contracts.

Deployment:
when deploying,you need to create account "personal.bos" and set this contract to it to let it work.
Thaipanda
Thaipanda previously approved these changes Mar 27, 2019

//sethomepage check
//long url check
string *long_url=new string(257,'a');
Copy link

@vlbos vlbos Mar 27, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no delete long_url,memory leak. use long_url.assign(257,'a');

);

//value length check
string* long_value=new string(1025,'a');
Copy link

@vlbos vlbos Mar 27, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no delete long_value,memory leak. use long_value.assign(1025,'a');

@Thaipanda Thaipanda self-requested a review March 27, 2019 11:54
@Thaipanda Thaipanda merged commit 4a0d96d into boscore:develop Mar 27, 2019
vlbos pushed a commit to vlbos/bos.contracts that referenced this pull request Nov 26, 2019
bumped the version to 1.3.0 and changed wasmsdk to cdt
vlbos pushed a commit to vlbos/bos.contracts that referenced this pull request Nov 26, 2019
* add new contract: personal.bos ,which contains actions:

1.setpersonal
2.sethomepage
this contract has a table "personaldata" ,which's a key-value map to store customized public info for accounts. it has 2 columns:
   key: the primary key
   value: the value, should be less than 1024.
setpersonal:user can call to set the key-value they wish,and read it via get table.
sethomepage:the same with setpersonal, just the key is fixed to "homepage", by supplying homepage, dapp can easily guide user to their homepage.

with commits on "boscore/bos",user can also use "cleos set personal ..." and "cleos get account ..." to set personaldata and read homepage.
also add an inline interface "getpersonal" in personal.bos.hpp for easily accessing this multi-index for contracts.

Deployment:
when deploying,you need to create account "personal.bos" and set this contract to it to let it work.

* fix memory leak
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants