Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
plugin
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
link33
plugin
Commits
fc769ff1
Commit
fc769ff1
authored
Apr 01, 2021
by
袁兴强
Committed by
33cn
Apr 02, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update evidence
parent
2f09202f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
33 deletions
+3
-33
evidence.cpp
plugin/dapp/wasm/contracts/evidence/evidence.cpp
+3
-33
evidence.wasm
plugin/dapp/wasm/contracts/evidence/evidence.wasm
+0
-0
No files found.
plugin/dapp/wasm/contracts/evidence/evidence.cpp
View file @
fc769ff1
...
@@ -33,15 +33,7 @@ int DelStateTx()
...
@@ -33,15 +33,7 @@ int DelStateTx()
printlog
(
info
,
string_size
(
info
));
printlog
(
info
,
string_size
(
info
));
return
-
1
;
return
-
1
;
}
}
//size_t getStateDB(const char* key, size_t k_len, char* value, size_t v_len);
char
ChValue
[
128
]
=
{
0
};
getStateDB
(
ChKey
,
string_size
(
ChKey
),
ChValue
,
sizeof
(
ChValue
));
if
(
string_size
(
ChValue
)
==
0
)
{
//记录存在,但是之前删除过了
const
char
info
[
128
]
=
"DelStateTx::getStateDB Has Been Deleted
\0
"
;
printlog
(
info
,
string_size
(
info
));
return
-
1
;
}
char
ChNull
[
128
]
=
{
0
};
char
ChNull
[
128
]
=
{
0
};
setStateDB
(
ChKey
,
string_size
(
ChKey
),
ChNull
,
string_size
(
ChNull
));
setStateDB
(
ChKey
,
string_size
(
ChKey
),
ChNull
,
string_size
(
ChNull
));
const
char
info
[
128
]
=
"DelStateTx::Exec setStateDB Del OK
\0
"
;
const
char
info
[
128
]
=
"DelStateTx::Exec setStateDB Del OK
\0
"
;
...
@@ -57,20 +49,12 @@ int ModStateTx()
...
@@ -57,20 +49,12 @@ int ModStateTx()
getENV
(
0
,
ChKey
,
getENVSize
(
0
));
getENV
(
0
,
ChKey
,
getENVSize
(
0
));
getENV
(
1
,
ChValue
,
getENVSize
(
1
));
getENV
(
1
,
ChValue
,
getENVSize
(
1
));
if
((
string_size
(
ChKey
)
==
0
)
||
(
string_size
(
ChValue
)
==
0
))
return
-
1
;
if
((
string_size
(
ChKey
)
==
0
)
||
(
string_size
(
ChValue
)
==
0
))
return
-
1
;
//查询旧值,非空为存在旧值
,为空则表示这个记录已经被删除过
//查询旧值,非空为存在旧值
if
(
getStateDBSize
(
ChKey
,
string_size
(
ChKey
))
==
0
)
{
if
(
getStateDBSize
(
ChKey
,
string_size
(
ChKey
))
==
0
)
{
const
char
info
[
128
]
=
"ModStateTx::getStateDBSize failed
\0
"
;
const
char
info
[
128
]
=
"ModStateTx::getStateDBSize failed
\0
"
;
printlog
(
info
,
string_size
(
info
));
printlog
(
info
,
string_size
(
info
));
return
-
1
;
return
-
1
;
}
}
//在判断这条记录value是否为空,如果是则为已经被删除的记录,如此修改操作不允许
char
value
[
128
]
=
{
0
};
getStateDB
(
ChKey
,
string_size
(
ChKey
),
value
,
sizeof
(
value
));
if
(
string_size
(
value
)
==
0
)
{
const
char
info
[
128
]
=
"ModStateTx::getStateDB Has Been Deleted
\0
"
;
printlog
(
info
,
string_size
(
info
));
return
-
1
;
}
setStateDB
(
ChKey
,
string_size
(
ChKey
),
ChValue
,
string_size
(
ChValue
));
setStateDB
(
ChKey
,
string_size
(
ChKey
),
ChValue
,
string_size
(
ChValue
));
const
char
info
[
128
]
=
"ModStateTx::Exec setStateDB Update OK
\0
"
;
const
char
info
[
128
]
=
"ModStateTx::Exec setStateDB Update OK
\0
"
;
printlog
(
info
,
string_size
(
info
));
printlog
(
info
,
string_size
(
info
));
...
@@ -104,14 +88,6 @@ int DelLocalTx()
...
@@ -104,14 +88,6 @@ int DelLocalTx()
printlog
(
info
,
string_size
(
info
));
printlog
(
info
,
string_size
(
info
));
return
-
1
;
return
-
1
;
}
}
char
ChValue
[
128
]
=
{
0
};
getLocalDB
(
ChKey
,
string_size
(
ChKey
),
ChValue
,
sizeof
(
ChValue
));
if
(
string_size
(
ChValue
)
==
0
)
{
//记录存在,但是之前删除过了
const
char
info
[
128
]
=
"DelLocalTx::getLocalDB Has Been Deleted
\0
"
;
printlog
(
info
,
string_size
(
info
));
return
-
1
;
}
char
ChNull
[
128
]
=
{
0
};
char
ChNull
[
128
]
=
{
0
};
setLocalDB
(
ChKey
,
string_size
(
ChKey
),
ChNull
,
string_size
(
ChNull
));
setLocalDB
(
ChKey
,
string_size
(
ChKey
),
ChNull
,
string_size
(
ChNull
));
const
char
info
[
128
]
=
"DelLocalTx::Exec Delete OK
\0
"
;
const
char
info
[
128
]
=
"DelLocalTx::Exec Delete OK
\0
"
;
...
@@ -133,13 +109,7 @@ int ModLocalTx()
...
@@ -133,13 +109,7 @@ int ModLocalTx()
printlog
(
info
,
string_size
(
info
));
printlog
(
info
,
string_size
(
info
));
return
-
1
;
return
-
1
;
}
}
char
value
[
128
]
=
{
0
};
getLocalDB
(
ChKey
,
string_size
(
ChKey
),
value
,
sizeof
(
value
));
if
(
string_size
(
value
)
==
0
)
{
const
char
info
[
128
]
=
"ModLocalTx::getLocalDB Has Been Deleted
\0
"
;
printlog
(
info
,
string_size
(
info
));
return
-
1
;
}
setLocalDB
(
ChKey
,
string_size
(
ChKey
),
ChValue
,
string_size
(
ChValue
));
setLocalDB
(
ChKey
,
string_size
(
ChKey
),
ChValue
,
string_size
(
ChValue
));
const
char
info
[
128
]
=
"ModLocalTx::Exec setLocalDB Update OK
\0
"
;
const
char
info
[
128
]
=
"ModLocalTx::Exec setLocalDB Update OK
\0
"
;
printlog
(
info
,
string_size
(
info
));
printlog
(
info
,
string_size
(
info
));
...
...
plugin/dapp/wasm/contracts/evidence/evidence.wasm
View file @
fc769ff1
No preview for this file type
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment