Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
TSA
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
blockchain
TSA
Commits
7b89cad7
Commit
7b89cad7
authored
6 years ago
by
Robert Martin-Legene
Browse files
Options
Downloads
Patches
Plain Diff
Tratando de hacer el SC acceptar una lista. Falta actualizar el ABI en local_settings.py
parent
cf1a8a77
No related branches found
No related tags found
1 merge request
!1
replayfix+listfeature
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
SmartContracts/ProofOfExistence.sol
+10
-3
10 additions, 3 deletions
SmartContracts/ProofOfExistence.sol
api/app/managers.py
+1
-1
1 addition, 1 deletion
api/app/managers.py
with
11 additions
and
4 deletions
SmartContracts/ProofOfExistence.sol
+
10
−
3
View file @
7b89cad7
...
@@ -8,9 +8,16 @@ contract ProofOfExistence {
...
@@ -8,9 +8,16 @@ contract ProofOfExistence {
mapping (uint256 => Dato) private hashstore;
mapping (uint256 => Dato) private hashstore;
function stamp(uint256 ots, uint256 file_hash) public {
function stamp(uint256[] incoming) public {
if ( hashstore[ots] == 0 )
uint256 len = incoming.length;
hashstore[ots] = Dato({blockNumber: block.number, hash: file_hash});
uint256 i = 0;
while ( i+1 < len )
{
uint256 ots = incoming[i++];
uint256 file_hash = incoming[i++];
if ( hashstore[ots] == 0 )
hashstore[ots] = Dato({blockNumber: block.number, hash: file_hash});
}
}
}
function verify(uint256 ots, uint256 file_hash) public view returns(bool){
function verify(uint256 ots, uint256 file_hash) public view returns(bool){
...
...
This diff is collapsed.
Click to expand it.
api/app/managers.py
+
1
−
1
View file @
7b89cad7
...
@@ -52,7 +52,7 @@ class TimestampManager(models.Manager):
...
@@ -52,7 +52,7 @@ class TimestampManager(models.Manager):
def
stamp
(
ots_hash
,
file_hash
):
def
stamp
(
ots_hash
,
file_hash
):
contract
=
TimestampManager
.
get_current_contract
()
contract
=
TimestampManager
.
get_current_contract
()
return
contract
.
functions
.
stamp
(
ots_hash
,
file_hash
).
transact
({
'
from
'
:
Web3
.
toChecksumAddress
(
ACCOUNT_ADDRESS
)})
return
contract
.
functions
.
stamp
(
[
ots_hash
,
file_hash
]
).
transact
({
'
from
'
:
Web3
.
toChecksumAddress
(
ACCOUNT_ADDRESS
)})
@staticmethod
@staticmethod
def
verify
(
contract_version
,
ots_hash
,
file_hash
):
def
verify
(
contract_version
,
ots_hash
,
file_hash
):
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment