Skip to content
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

let some functions public for customization #132

Merged
merged 1 commit into from
Mar 26, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion web3swift/Promises/Classes/Promise+Batching.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public class JSONRPCrequestDispatcher {
private var lockQueue: DispatchQueue
private var batches: [Batch] = [Batch]()

init(provider: Web3Provider, queue: DispatchQueue, policy: DispatchPolicy) {
public init(provider: Web3Provider, queue: DispatchQueue, policy: DispatchPolicy) {
self.provider = provider
self.queue = queue
self.policy = policy
Expand Down
8 changes: 4 additions & 4 deletions web3swift/Web3/Classes/Web3+JSONRPC.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ public struct Counter {

/// JSON RPC request structure for serialization and deserialization purposes.
public struct JSONRPCrequest: Encodable {
var jsonrpc: String = "2.0"
var method: JSONRPCmethod?
var params: JSONRPCparams?
var id: UInt64 = Counter.increment()
public var jsonrpc: String = "2.0"
public var method: JSONRPCmethod?
public var params: JSONRPCparams?
public var id: UInt64 = Counter.increment()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understand that public constructor for a “Dispatcher” may be necessary, but request should not be messed up with (or please provide a concrete example for what reason). May be extending a list of JSONRPCmethod is better approach?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I want to integrate web3 with native wallet app and need to read method/params/id to determine whether to intercept the request. For example, I want to intercept eth.sendTransaction request and handle it by myself, so I need to know method first and then use id / params to process the request.


enum CodingKeys: String, CodingKey {
case jsonrpc
Expand Down