Skip to content

Commit

Permalink
authorization in set passcode
Browse files Browse the repository at this point in the history
  • Loading branch information
MrishoLukamba committed Aug 6, 2023
1 parent 1c1cdbd commit 8ed5f82
Show file tree
Hide file tree
Showing 11 changed files with 24 additions and 19 deletions.
2 changes: 1 addition & 1 deletion ordum-research-phala/artifacts/ordum.contract

Large diffs are not rendered by default.

28 changes: 14 additions & 14 deletions ordum-research-phala/artifacts/ordum.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"source": {
"hash": "0xc5ea4e207c6c0ba64fcad4df6442af913646d0fe47eee4989ee5dbf6d9c01c11",
"hash": "0x96cc866af910332434c4ab91cbc6aaa0bbee1fa06bb3f40a9515c3ada75e8aaa",
"language": "ink! 4.2.1",
"compiler": "rustc 1.69.0",
"build_info": {
Expand Down Expand Up @@ -443,7 +443,7 @@
],
"default": false,
"docs": [],
"label": "create_individual_profile",
"label": "CreateProfile::create_individual_profile",
"mutates": true,
"payable": false,
"returnType": {
Expand Down Expand Up @@ -505,7 +505,7 @@
],
"default": false,
"docs": [],
"label": "update_individual_profile",
"label": "CreateProfile::update_individual_profile",
"mutates": true,
"payable": false,
"returnType": {
Expand Down Expand Up @@ -594,7 +594,7 @@
],
"default": false,
"docs": [],
"label": "create_applicant_profile",
"label": "CreateProfile::create_applicant_profile",
"mutates": true,
"payable": false,
"returnType": {
Expand Down Expand Up @@ -629,7 +629,7 @@
],
"default": false,
"docs": [],
"label": "update_keys",
"label": "CreateProfile::update_keys",
"mutates": true,
"payable": false,
"returnType": {
Expand Down Expand Up @@ -682,7 +682,7 @@
],
"default": false,
"docs": [],
"label": "add_proposal",
"label": "Proposer::add_proposal",
"mutates": true,
"payable": false,
"returnType": {
Expand All @@ -708,7 +708,7 @@
],
"default": false,
"docs": [],
"label": "fetch_proposal",
"label": "Proposer::fetch_proposal",
"mutates": false,
"payable": false,
"returnType": {
Expand Down Expand Up @@ -752,7 +752,7 @@
],
"default": false,
"docs": [],
"label": "add_milestone",
"label": "MilestoneTracker::add_milestone",
"mutates": true,
"payable": false,
"returnType": {
Expand Down Expand Up @@ -805,7 +805,7 @@
],
"default": false,
"docs": [],
"label": "edit_milestone",
"label": "MilestoneTracker::edit_milestone",
"mutates": true,
"payable": false,
"returnType": {
Expand Down Expand Up @@ -858,7 +858,7 @@
],
"default": false,
"docs": [],
"label": "pivote_milestone",
"label": "MilestoneTracker::pivote_milestone",
"mutates": true,
"payable": false,
"returnType": {
Expand Down Expand Up @@ -893,7 +893,7 @@
],
"default": false,
"docs": [],
"label": "fetch_milestone",
"label": "MilestoneTracker::fetch_milestone",
"mutates": false,
"payable": false,
"returnType": {
Expand All @@ -909,7 +909,7 @@
"args": [],
"default": false,
"docs": [],
"label": "get_random",
"label": "OffchainDbAuth::get_random",
"mutates": false,
"payable": false,
"returnType": {
Expand Down Expand Up @@ -944,7 +944,7 @@
],
"default": false,
"docs": [],
"label": "set_passcode",
"label": "OffchainDbAuth::set_passcode",
"mutates": true,
"payable": false,
"returnType": {
Expand All @@ -960,7 +960,7 @@
"args": [],
"default": false,
"docs": [],
"label": "get_passcode",
"label": "OffchainDbAuth::get_passcode",
"mutates": false,
"payable": false,
"returnType": {
Expand Down
Binary file modified ordum-research-phala/artifacts/ordum.wasm
Binary file not shown.
5 changes: 5 additions & 0 deletions ordum-research-phala/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1585,6 +1585,11 @@ mod ordum {
#[ink(message, selector= 0xC0DE0017)]
fn set_passcode(&mut self,rand:Vec<u8>,name: String) -> CreateResult<()>{
let caller = Self::env().caller();

// check if the accountis already there
if self.db_auth.contains(caller){
Err(Error::AccountExists)?
}
// Hash caller + rand
let mut preimage = caller.encode().to_vec();
preimage.append(&mut rand.encode().to_vec());
Expand Down
2 changes: 1 addition & 1 deletion ordum-research-phala/target/.rustc_info.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"rustc_fingerprint":9038470289864895377,"outputs":{"15481046163696847946":{"success":true,"status":"","code":0,"stdout":"___\nlib___.rlib\nlib___.dylib\nlib___.dylib\nlib___.a\nlib___.dylib\n/Users/mrisholukamba/.rustup/toolchains/1.69-aarch64-apple-darwin\noff\npacked\nunpacked\n___\ndebug_assertions\npanic=\"unwind\"\nproc_macro\ntarget_arch=\"aarch64\"\ntarget_endian=\"little\"\ntarget_env=\"\"\ntarget_family=\"unix\"\ntarget_feature=\"aes\"\ntarget_feature=\"crc\"\ntarget_feature=\"dit\"\ntarget_feature=\"dotprod\"\ntarget_feature=\"dpb\"\ntarget_feature=\"dpb2\"\ntarget_feature=\"fcma\"\ntarget_feature=\"fhm\"\ntarget_feature=\"flagm\"\ntarget_feature=\"fp16\"\ntarget_feature=\"frintts\"\ntarget_feature=\"jsconv\"\ntarget_feature=\"lor\"\ntarget_feature=\"lse\"\ntarget_feature=\"neon\"\ntarget_feature=\"paca\"\ntarget_feature=\"pacg\"\ntarget_feature=\"pan\"\ntarget_feature=\"pmuv3\"\ntarget_feature=\"ras\"\ntarget_feature=\"rcpc\"\ntarget_feature=\"rcpc2\"\ntarget_feature=\"rdm\"\ntarget_feature=\"sb\"\ntarget_feature=\"sha2\"\ntarget_feature=\"sha3\"\ntarget_feature=\"ssbs\"\ntarget_feature=\"vh\"\ntarget_has_atomic=\"128\"\ntarget_has_atomic=\"16\"\ntarget_has_atomic=\"32\"\ntarget_has_atomic=\"64\"\ntarget_has_atomic=\"8\"\ntarget_has_atomic=\"ptr\"\ntarget_os=\"macos\"\ntarget_pointer_width=\"64\"\ntarget_vendor=\"apple\"\nunix\n","stderr":""},"15729799797837862367":{"success":true,"status":"","code":0,"stdout":"___\nlib___.rlib\nlib___.dylib\nlib___.dylib\nlib___.a\nlib___.dylib\n/Users/mrisholukamba/.rustup/toolchains/1.69-aarch64-apple-darwin\noff\npacked\nunpacked\n___\ndebug_assertions\npanic=\"unwind\"\nproc_macro\ntarget_arch=\"aarch64\"\ntarget_endian=\"little\"\ntarget_env=\"\"\ntarget_family=\"unix\"\ntarget_feature=\"aes\"\ntarget_feature=\"crc\"\ntarget_feature=\"dit\"\ntarget_feature=\"dotprod\"\ntarget_feature=\"dpb\"\ntarget_feature=\"dpb2\"\ntarget_feature=\"fcma\"\ntarget_feature=\"fhm\"\ntarget_feature=\"flagm\"\ntarget_feature=\"fp16\"\ntarget_feature=\"frintts\"\ntarget_feature=\"jsconv\"\ntarget_feature=\"lor\"\ntarget_feature=\"lse\"\ntarget_feature=\"neon\"\ntarget_feature=\"paca\"\ntarget_feature=\"pacg\"\ntarget_feature=\"pan\"\ntarget_feature=\"pmuv3\"\ntarget_feature=\"ras\"\ntarget_feature=\"rcpc\"\ntarget_feature=\"rcpc2\"\ntarget_feature=\"rdm\"\ntarget_feature=\"sb\"\ntarget_feature=\"sha2\"\ntarget_feature=\"sha3\"\ntarget_feature=\"ssbs\"\ntarget_feature=\"vh\"\ntarget_has_atomic=\"128\"\ntarget_has_atomic=\"16\"\ntarget_has_atomic=\"32\"\ntarget_has_atomic=\"64\"\ntarget_has_atomic=\"8\"\ntarget_has_atomic=\"ptr\"\ntarget_os=\"macos\"\ntarget_pointer_width=\"64\"\ntarget_vendor=\"apple\"\nunix\n","stderr":""},"4614504638168534921":{"success":true,"status":"","code":0,"stdout":"rustc 1.69.0 (84c898d65 2023-04-16)\nbinary: rustc\ncommit-hash: 84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc\ncommit-date: 2023-04-16\nhost: aarch64-apple-darwin\nrelease: 1.69.0\nLLVM version: 15.0.7\n","stderr":""}},"successes":{}}
{"rustc_fingerprint":9038470289864895377,"outputs":{"4614504638168534921":{"success":true,"status":"","code":0,"stdout":"rustc 1.69.0 (84c898d65 2023-04-16)\nbinary: rustc\ncommit-hash: 84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc\ncommit-date: 2023-04-16\nhost: aarch64-apple-darwin\nrelease: 1.69.0\nLLVM version: 15.0.7\n","stderr":""},"15729799797837862367":{"success":true,"status":"","code":0,"stdout":"___\nlib___.rlib\nlib___.dylib\nlib___.dylib\nlib___.a\nlib___.dylib\n/Users/mrisholukamba/.rustup/toolchains/1.69-aarch64-apple-darwin\noff\npacked\nunpacked\n___\ndebug_assertions\npanic=\"unwind\"\nproc_macro\ntarget_arch=\"aarch64\"\ntarget_endian=\"little\"\ntarget_env=\"\"\ntarget_family=\"unix\"\ntarget_feature=\"aes\"\ntarget_feature=\"crc\"\ntarget_feature=\"dit\"\ntarget_feature=\"dotprod\"\ntarget_feature=\"dpb\"\ntarget_feature=\"dpb2\"\ntarget_feature=\"fcma\"\ntarget_feature=\"fhm\"\ntarget_feature=\"flagm\"\ntarget_feature=\"fp16\"\ntarget_feature=\"frintts\"\ntarget_feature=\"jsconv\"\ntarget_feature=\"lor\"\ntarget_feature=\"lse\"\ntarget_feature=\"neon\"\ntarget_feature=\"paca\"\ntarget_feature=\"pacg\"\ntarget_feature=\"pan\"\ntarget_feature=\"pmuv3\"\ntarget_feature=\"ras\"\ntarget_feature=\"rcpc\"\ntarget_feature=\"rcpc2\"\ntarget_feature=\"rdm\"\ntarget_feature=\"sb\"\ntarget_feature=\"sha2\"\ntarget_feature=\"sha3\"\ntarget_feature=\"ssbs\"\ntarget_feature=\"vh\"\ntarget_has_atomic=\"128\"\ntarget_has_atomic=\"16\"\ntarget_has_atomic=\"32\"\ntarget_has_atomic=\"64\"\ntarget_has_atomic=\"8\"\ntarget_has_atomic=\"ptr\"\ntarget_os=\"macos\"\ntarget_pointer_width=\"64\"\ntarget_vendor=\"apple\"\nunix\n","stderr":""},"15481046163696847946":{"success":true,"status":"","code":0,"stdout":"___\nlib___.rlib\nlib___.dylib\nlib___.dylib\nlib___.a\nlib___.dylib\n/Users/mrisholukamba/.rustup/toolchains/1.69-aarch64-apple-darwin\noff\npacked\nunpacked\n___\ndebug_assertions\npanic=\"unwind\"\nproc_macro\ntarget_arch=\"aarch64\"\ntarget_endian=\"little\"\ntarget_env=\"\"\ntarget_family=\"unix\"\ntarget_feature=\"aes\"\ntarget_feature=\"crc\"\ntarget_feature=\"dit\"\ntarget_feature=\"dotprod\"\ntarget_feature=\"dpb\"\ntarget_feature=\"dpb2\"\ntarget_feature=\"fcma\"\ntarget_feature=\"fhm\"\ntarget_feature=\"flagm\"\ntarget_feature=\"fp16\"\ntarget_feature=\"frintts\"\ntarget_feature=\"jsconv\"\ntarget_feature=\"lor\"\ntarget_feature=\"lse\"\ntarget_feature=\"neon\"\ntarget_feature=\"paca\"\ntarget_feature=\"pacg\"\ntarget_feature=\"pan\"\ntarget_feature=\"pmuv3\"\ntarget_feature=\"ras\"\ntarget_feature=\"rcpc\"\ntarget_feature=\"rcpc2\"\ntarget_feature=\"rdm\"\ntarget_feature=\"sb\"\ntarget_feature=\"sha2\"\ntarget_feature=\"sha3\"\ntarget_feature=\"ssbs\"\ntarget_feature=\"vh\"\ntarget_has_atomic=\"128\"\ntarget_has_atomic=\"16\"\ntarget_has_atomic=\"32\"\ntarget_has_atomic=\"64\"\ntarget_has_atomic=\"8\"\ntarget_has_atomic=\"ptr\"\ntarget_os=\"macos\"\ntarget_pointer_width=\"64\"\ntarget_vendor=\"apple\"\nunix\n","stderr":""}},"successes":{}}
2 changes: 1 addition & 1 deletion ordum-research-phala/target/ink/ordum.contract

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion ordum-research-phala/target/ink/ordum.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"source": {
"hash": "0xc5ea4e207c6c0ba64fcad4df6442af913646d0fe47eee4989ee5dbf6d9c01c11",
"hash": "0x96cc866af910332434c4ab91cbc6aaa0bbee1fa06bb3f40a9515c3ada75e8aaa",
"language": "ink! 4.2.1",
"compiler": "rustc 1.69.0",
"build_info": {
Expand Down
Binary file modified ordum-research-phala/target/ink/ordum.wasm
Binary file not shown.
Binary file modified ordum-research-phala/target/ink/release/metadata-gen
Binary file not shown.
2 changes: 1 addition & 1 deletion ordum-research-phala/target/ink/release/metadata-gen.d
Original file line number Diff line number Diff line change
@@ -1 +1 @@
/Users/mrisholukamba/Desktop/Ordum/Backend-research/ordum-research-phala/target/ink/release/metadata-gen: /Users/mrisholukamba/Desktop/Ordum/Backend-research/ordum-research-phala/src/lib.rs /private/var/folders/2p/r9b2d89n1fl_02bbk2m9t9k40000gn/T/cargo-contract_nPFydu/.ink/metadata_gen/main.rs
/Users/mrisholukamba/Desktop/Ordum/Backend-research/ordum-research-phala/target/ink/release/metadata-gen: /Users/mrisholukamba/Desktop/Ordum/Backend-research/ordum-research-phala/src/lib.rs /private/var/folders/2p/r9b2d89n1fl_02bbk2m9t9k40000gn/T/cargo-contract_QA5eyh/.ink/metadata_gen/main.rs
Binary file not shown.

0 comments on commit 8ed5f82

Please sign in to comment.