You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In #143 the options for both adapters are in 1 struct, separate the struct into 2 structs for each Adapter:
Dummy Adapter options struct
Ethereum Adapter options struct
This will ensure not to check for all the required options in the specific adapter and will remove a lot of this code in the init functions.
Another option is to use an Enum and have a default init fn taking it and have a TryFrom<ConfigStructForEthereum> for EthereumAdapter
@samparsky Also for the Keystore file, why don't we just deserialize it into an object instead of keystore_json: Value, and instead of doing let address = match keystore_json["address"].as_str() { .... }; we can ensure that the passed Keystore file is correct and we can use that struct in the Ethereum adapter like keystore: Keystore instead of serdeValue
The text was updated successfully, but these errors were encountered:
In #143 the options for both adapters are in 1 struct, separate the struct into 2 structs for each Adapter:
This will ensure not to check for all the required options in the specific adapter and will remove a lot of this code in the
init
functions.Another option is to use an Enum and have a default
init
fn taking it and have aTryFrom<ConfigStructForEthereum> for EthereumAdapter
@samparsky Also for the
Keystore file
, why don't we just deserialize it into an object instead ofkeystore_json: Value,
and instead of doinglet address = match keystore_json["address"].as_str() { .... };
we can ensure that the passed Keystore file is correct and we can use that struct in the Ethereum adapter likekeystore: Keystore
instead ofserde
Value
The text was updated successfully, but these errors were encountered: