-
Notifications
You must be signed in to change notification settings - Fork 11
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 #60 from novasamatech/feature/support-metadata-proof
Add parameters generation for extrinsic proof
- Loading branch information
Showing
5 changed files
with
115 additions
and
3 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
30 changes: 30 additions & 0 deletions
30
SubstrateSdk/Classes/Extrinsic/ExtrinsicBuilderSnapshot.swift
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,30 @@ | ||
import Foundation | ||
import BigInt | ||
|
||
public protocol ExtrinsicBuilderMemoProtocol { | ||
func restoreBuilder() -> ExtrinsicBuilderProtocol | ||
} | ||
|
||
struct ExtrinsicBuilderMemo { | ||
let specVersion: UInt32 | ||
let transactionVersion: UInt32 | ||
let genesisHash: String | ||
let calls: [JSON] | ||
let blockHash: String | ||
let address: JSON? | ||
let nonce: UInt32 | ||
let era: Era | ||
let tip: BigUInt | ||
let signature: ExtrinsicSignature? | ||
let signaturePayloadFormat: ExtrinsicSignaturePayloadFormat | ||
let metadataHash: Data? | ||
let batchType: ExtrinsicBatch | ||
let runtimeJsonContext: RuntimeJsonContext? | ||
let additionalExtensions: [ExtrinsicSignedExtending] | ||
} | ||
|
||
extension ExtrinsicBuilderMemo: ExtrinsicBuilderMemoProtocol { | ||
func restoreBuilder() -> ExtrinsicBuilderProtocol { | ||
ExtrinsicBuilder(memo: self) | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
SubstrateSdk/Classes/Extrinsic/ExtrinsicSignatureParams.swift
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,13 @@ | ||
import Foundation | ||
|
||
public struct ExtrinsicSignatureParams { | ||
public let encodedCall: Data | ||
public let includedInExtrinsicExtra: Data | ||
public let includedInSignatureExtra: Data | ||
|
||
public init(encodedCall: Data, includedInExtrinsicExtra: Data, includedInSignatureExtra: Data) { | ||
self.encodedCall = encodedCall | ||
self.includedInExtrinsicExtra = includedInExtrinsicExtra | ||
self.includedInSignatureExtra = includedInSignatureExtra | ||
} | ||
} |