NewHTTPClient initiates an instance of a light client using HTTP addresses for both the primary provider and witnesses of the light client. A trusted header and hash must be passed to initialize the client. See all Option(s) for the additional configuration. See NewClient.
( ctx context.Context, chainID string, trustOptions TrustOptions, primaryAddress string, witnessesAddresses []string, trustedStore store.Store, options ...Option)
| 16 | // See all Option(s) for the additional configuration. |
| 17 | // See NewClient. |
| 18 | func NewHTTPClient( |
| 19 | ctx context.Context, |
| 20 | chainID string, |
| 21 | trustOptions TrustOptions, |
| 22 | primaryAddress string, |
| 23 | witnessesAddresses []string, |
| 24 | trustedStore store.Store, |
| 25 | options ...Option) (*Client, error) { |
| 26 | |
| 27 | providers, err := providersFromAddresses(append(witnessesAddresses, primaryAddress), chainID) |
| 28 | if err != nil { |
| 29 | return nil, err |
| 30 | } |
| 31 | |
| 32 | return NewClient( |
| 33 | ctx, |
| 34 | chainID, |
| 35 | trustOptions, |
| 36 | providers[len(providers)-1], |
| 37 | providers[:len(providers)-1], |
| 38 | trustedStore, |
| 39 | options...) |
| 40 | } |
| 41 | |
| 42 | // NewHTTPClientFromTrustedStore initiates an instance of a light client using |
| 43 | // HTTP addresses for both the primary provider and witnesses and uses a |
no test coverage detected
searching dependent graphs…