-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #26 from XYOracleNetwork/feature/dollar-sign-meta-…
…signatures Feature/dollar sign meta signatures
- Loading branch information
Showing
9 changed files
with
64 additions
and
33 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
29 changes: 24 additions & 5 deletions
29
sdk/src/main/java/network/xyo/client/boundwitness/XyoBoundWitnessJson.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 |
---|---|---|
@@ -1,14 +1,33 @@ | ||
package network.xyo.client.boundwitness | ||
|
||
import com.squareup.moshi.Json | ||
import com.squareup.moshi.JsonClass | ||
|
||
@JsonClass(generateAdapter = true) | ||
open class XyoBoundWitnessJson: XyoBoundWitnessBodyJson(), XyoBoundWitnessMetaInterface { | ||
override var _signatures: List<String>? = null | ||
override var _client: String? = null | ||
override var _hash: String? = null | ||
class XyoBoundWitnessMeta: XyoBoundWitnessMetaInterface { | ||
override var signatures: List<String>? = null | ||
override var client: String? = null | ||
} | ||
|
||
@JsonClass(generateAdapter = true) | ||
open class XyoBoundWitnessJson: XyoBoundWitnessBodyJson() { | ||
@Json(ignore = true) | ||
val _meta: XyoBoundWitnessMeta = XyoBoundWitnessMeta() | ||
|
||
@Json(name = "\$meta") | ||
var meta: XyoBoundWitnessMeta | ||
get() = _meta | ||
set(value) = Unit | ||
|
||
override fun hash(): String { | ||
return getBodyJson().hash() | ||
} | ||
|
||
fun rootHash(): String { | ||
return sha256String(this) | ||
} | ||
|
||
open fun getBodyJson(): XyoBoundWitnessBodyJson { | ||
return this | ||
return XyoBoundWitnessBodyJson(this.addresses, this.previous_hashes, this.payload_hashes, this.payload_schemas, this.timestamp) | ||
} | ||
} |
9 changes: 3 additions & 6 deletions
9
sdk/src/main/java/network/xyo/client/boundwitness/XyoBoundWitnessMetaInterface.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 |
---|---|---|
@@ -1,9 +1,6 @@ | ||
package network.xyo.client.boundwitness | ||
|
||
import network.xyo.client.payload.Payload | ||
|
||
interface XyoBoundWitnessMetaInterface : Payload { | ||
var _hash: String? | ||
var _signatures: List<String>? | ||
var _client: String? | ||
interface XyoBoundWitnessMetaInterface { | ||
var signatures: List<String>? | ||
var client: String? | ||
} |
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