Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
22 changed files
with
352 additions
and
38 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
26 changes: 26 additions & 0 deletions
26
...testdata/blocks/0x7ce3d93396dac53f1ae5fba268afcaa623e224e359507d581439dea791bab971 2.json
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,26 @@ | ||
{ | ||
"jsonrpc": "2.0", | ||
"result": { | ||
"block": { | ||
"extrinsics": [ | ||
"0x280402000ba0fa77987101", | ||
"0x1c040b007ab03f00", | ||
"0xd10384fff49a6b6deb3cdb00d86e735ced8f48b649273fc6ff6a3bbba021a6b4a1c5d06701b6f94ea763c250533409727e26eda6f67661c8da4190dbf0988c4e0c4ee14465efe0f64267e836aeee21a7d44aec1c82a2013c8dd064aebe27559db0cece9b83007c000e02ff2a9aff809089623c64ccd7ca79b8fffb114cef2c251b2b3e4f2d5144eee962fb0002f40100910130783664363136393663363336383631363936653031306132353230303130313136323065666639663438333061373038653364373938333635363861306161346136343063353034643034383938343139363738333361306439633965353162366533" | ||
], | ||
"header": { | ||
"digest": { | ||
"logs": [ | ||
"0x06617572612026f8c40f00000000", | ||
"0x0561757261010135748ca2ac77a329c7053b38bff94a18a504df23aea9a9c8e03e06f479b334b384996a0021447b5a4afebd32f2ee6ceb8cc832b107f7cd35400e5a17854d0407" | ||
] | ||
}, | ||
"extrinsicsRoot": "0x8765cd86b8d08b63fb315855894f5c357c4b25670c131f96b5bbad5aab6971a5", | ||
"number": "0xfec21", | ||
"parentHash": "0xf145d056d93bc8e1661cf334763b475f32ab3ee0155e3d6a33c825904509023d", | ||
"stateRoot": "0x0a2164eece05fab911adfd891ea1e02e9e11a0a1f18e05f61ffefecc99b5dabf" | ||
} | ||
}, | ||
"justification": null | ||
}, | ||
"id": 23 | ||
} |
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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,56 @@ | ||
package settings //nolint: dupl | ||
|
||
import ( | ||
"github.com/mailchain/mailchain/cmd/internal/settings/output" | ||
"github.com/mailchain/mailchain/cmd/internal/settings/values" | ||
"github.com/mailchain/mailchain/internal/clients/mailchain" | ||
"github.com/mailchain/mailchain/internal/mailbox" | ||
"github.com/mailchain/mailchain/internal/protocols" | ||
"github.com/mailchain/mailchain/internal/protocols/substrate" | ||
) | ||
|
||
// MailchainReceiver configuration element. | ||
type MailchainReceiver struct { | ||
EnabledProtocolNetworks values.StringSlice | ||
Address values.String | ||
} | ||
|
||
func mailchainReceiverNoAuth(s values.Store) *MailchainReceiver { | ||
return &MailchainReceiver{ | ||
Address: values.NewDefaultString("http://localhost:8081", s, "receivers.mailchain.address"), | ||
EnabledProtocolNetworks: values.NewDefaultStringSlice( | ||
[]string{ | ||
protocols.Substrate + "/" + substrate.EdgewareBerlin, | ||
protocols.Substrate + "/" + substrate.EdgewareMainnet, | ||
}, | ||
s, | ||
"receivers.mailchain.enabled-networks", | ||
), | ||
} | ||
} | ||
|
||
// Supports a map of what protocol and network combinations are supported. | ||
func (r MailchainReceiver) Supports() map[string]bool { | ||
m := map[string]bool{} | ||
for _, np := range r.EnabledProtocolNetworks.Get() { | ||
m[np] = true | ||
} | ||
|
||
return m | ||
} | ||
|
||
// Produce `mailbox.Receiver` based on configuration settings. | ||
func (r MailchainReceiver) Produce() (mailbox.Receiver, error) { | ||
return mailchain.NewReceiver(r.Address.Get()) | ||
} | ||
|
||
// Output configuration as an `output.Element` for use in exporting configuration. | ||
func (r MailchainReceiver) Output() output.Element { | ||
return output.Element{ | ||
FullName: "mailchain", | ||
Attributes: []output.Attribute{ | ||
r.EnabledProtocolNetworks.Attribute(), | ||
r.Address.Attribute(), | ||
}, | ||
} | ||
} |
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
Oops, something went wrong.