forked from Tribler/trustchain-superapp
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Callback ui updates, IPV8 ds prosecution
- Loading branch information
1 parent
1286d20
commit 584e914
Showing
38 changed files
with
1,589 additions
and
616 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
...main/java/nl/tudelft/trustchain/offlineeuro/community/message/FraudControlReplyMessage.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package nl.tudelft.trustchain.offlineeuro.community.message | ||
|
||
class FraudControlReplyMessage( | ||
val result: String, | ||
) : ICommunityMessage { | ||
override val messageType = CommunityMessageType.FraudControlReplyMessage | ||
} |
11 changes: 11 additions & 0 deletions
11
...in/java/nl/tudelft/trustchain/offlineeuro/community/message/FraudControlRequestMessage.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package nl.tudelft.trustchain.offlineeuro.community.message | ||
|
||
import nl.tudelft.ipv8.Peer | ||
|
||
class FraudControlRequestMessage( | ||
val firstProofBytes: ByteArray, | ||
val secondProofBytes: ByteArray, | ||
val requestingPeer: Peer | ||
) : ICommunityMessage { | ||
override val messageType = CommunityMessageType.FraudControlRequestMessage | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
...in/java/nl/tudelft/trustchain/offlineeuro/community/payload/FraudControlRequestPayload.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package nl.tudelft.trustchain.offlineeuro.community.payload | ||
|
||
import nl.tudelft.ipv8.messaging.Deserializable | ||
import nl.tudelft.ipv8.messaging.Serializable | ||
import nl.tudelft.ipv8.messaging.deserializeVarLen | ||
import nl.tudelft.ipv8.messaging.serializeVarLen | ||
|
||
class FraudControlRequestPayload( | ||
val firstProofBytes: ByteArray, | ||
val secondProofBytes: ByteArray | ||
) : Serializable { | ||
override fun serialize(): ByteArray { | ||
var payload = ByteArray(0) | ||
payload += serializeVarLen(firstProofBytes) | ||
payload += serializeVarLen(secondProofBytes) | ||
return payload | ||
} | ||
|
||
companion object Deserializer : Deserializable<FraudControlRequestPayload> { | ||
override fun deserialize( | ||
buffer: ByteArray, | ||
offset: Int | ||
): Pair<FraudControlRequestPayload, Int> { | ||
var localOffset = offset | ||
|
||
val (firstProofBytes, firstProofSize) = deserializeVarLen(buffer, localOffset) | ||
localOffset += firstProofSize | ||
|
||
val (secondProofBytes, secondProofSize) = deserializeVarLen(buffer, localOffset) | ||
localOffset += secondProofSize | ||
|
||
return Pair( | ||
FraudControlRequestPayload(firstProofBytes, secondProofBytes), | ||
localOffset - offset | ||
) | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.