-
Notifications
You must be signed in to change notification settings - Fork 64
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
Offline Digital Euro #157
base: master
Are you sure you want to change the base?
Offline Digital Euro #157
Conversation
Still not fully functional
…he Trustchain Superapp to have access to the initialized IPv8 network
…s initialized correctly compared to what I tried to use previously. Solved hashing BUG. The application now shows the promise as a QR code. Possible bug: transition automatically to set amount page, to be investigated.
…ularity_integration
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems alright, no major issue was identified but there are some bad practices in the code that should be addressed before the code enters the production android app.
// @Query("DELETE FROM userdata_table") | ||
// suspend fun deleteUserData() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Delete unused code
internal val privateKey: PrivateKey = defaultCryptoProvider.keyFromPrivateBin( | ||
byteArrayOf( | ||
76, 105, 98, 78, 97, 67, 76, 83, 75, 58, -29, -114, 126, -47, -39, -5, 22, 89, | ||
94, 71, -1, 118, -30, 120, -8, -75, 2, 102, 99, -21, 57, -95, 124, 126, -30, 33, | ||
-99, 37, -125, -105, 20, -45, 94, 2, -109, 125, 98, -52, 84, -54, -47, 13, 15, 75, | ||
73, 11, -128, 5, -4, -101, 102, -1, -95, 33, -107, -77, -41, 89, 102, 44, 71, 107, 1, 107 | ||
) | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seams unsafe, should not be hardcoded in the main codebase
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is only for the demo in order to be able sign generated tokens on any phone. In a real scenario this would not be here and we would use only the publick key to verify the signature. If we remove this, we break the demo functionality of the app. Is it ok to leave it here or how to you sugest to manage the situation?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Variable names in this file and the variable names in nl.tudelft.trustchain.offlinedigitaleuro.databinding.PrintMoneyFragmentBinding are not very explanatory, consider changing them
offlinedigitaleuro/build.gradle
Outdated
// kotlinOptions { | ||
// jvmTarget = '1.8' | ||
// } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
delete commented out code
offlinedigitaleuro/build.gradle
Outdated
// viewBinding { | ||
// enabled = true | ||
// } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
delete commented out code
|
||
adapter.registerRenderer(TransactionItemRenderer()) | ||
|
||
lifecycleScope.launchWhenResumed { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this launched in the background or will it lead to a chokehold?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is launched in the background and run only once.
lifecycleScope.launchWhenResumed { | ||
while(isActive) { | ||
val items = db.webOfTrustDao().getAllTrustScores() | ||
.map { trustScore: WebOfTrust -> TrustScoreItem(trustScore) } | ||
adapter.updateItems(items) | ||
adapter.notifyDataSetChanged() | ||
delay(1000L) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as the other file,is this launched in the background or may it lead to a chokehold?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is launched in the background and run only once now after the edit.
|
||
// completes a transaction and inserts the tokens in the DB | ||
// returns true if the operation succeeded and on failure also returns the message | ||
@SuppressLint("SimpleDateFormat") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not a good practice
// completes the transaction by deleting the transferred tokens from the DB and some other stuff | ||
// returns true if everything went fine | ||
// otherwise returns false and the error message | ||
@SuppressLint("SimpleDateFormat") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not a good practice
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
delete this file
Hello @OrestisKan |
Offline money transfer application with double spent token detection and trust loss for the detected double spender.