Skip to content

Commit

Permalink
Wallet transfer signing
Browse files Browse the repository at this point in the history
- make signMessage method public
- make WalletTransferEmptyKeySigner init public
  • Loading branch information
grishamsc committed Nov 18, 2023
1 parent d6d3437 commit 77babfe
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Source/TonSwift/Wallets/WalletContract.swift
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public struct WalletTransfer {
self.signingMessage = signingMessage
}

func signMessage(signer: WalletTransferSigner) throws -> Cell {
public func signMessage(signer: WalletTransferSigner) throws -> Cell {
let signature = try signer.signMessage(signingMessage.endCell().hash())
let body = Builder()
try body.store(data: signature)
Expand Down
2 changes: 2 additions & 0 deletions Source/TonSwift/Wallets/WalletTransferSigner.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ public struct WalletTransferSecretKeySigner: WalletTransferSigner {
}

public struct WalletTransferEmptyKeySigner: WalletTransferSigner {
public init() {}

public func signMessage(_ message: Data) throws -> Data {
guard let data = String(repeating: "0", count: .signatureBytesCount).data(using: .utf8) else {
throw WalletTransferSignerError.failedToSignMessage
Expand Down

0 comments on commit 77babfe

Please sign in to comment.