Skip to content

Commit

Permalink
Decode raw events using scale_value and return the decoded Values, too (
Browse files Browse the repository at this point in the history
#576)

* Decode raw events using scale_value and return the decoded Values, too

* cargo fmt

* cargo fmt and slight rearranging of test code
  • Loading branch information
jsdw authored Jun 22, 2022
1 parent a912986 commit 1e8d095
Show file tree
Hide file tree
Showing 7 changed files with 176 additions and 625 deletions.
2 changes: 1 addition & 1 deletion subxt/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ integration-tests = []
bitvec = { version = "1.0.0", default-features = false, features = ["alloc"] }
codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive", "full", "bit-vec"] }
scale-info = { version = "2.0.0", features = ["bit-vec"] }
scale-value = "0.2.0"
futures = "0.3.13"
hex = "0.4.3"
jsonrpsee = { version = "0.14.0", features = ["async-client", "client-ws-transport"] }
Expand All @@ -41,5 +42,4 @@ frame-metadata = "15.0.0"
derivative = "2.2.0"

[dev-dependencies]
assert_matches = "1.5.0"
tokio = { version = "1.8", features = ["macros", "time"] }
12 changes: 5 additions & 7 deletions subxt/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,13 @@
// You should have received a copy of the GNU General Public License
// along with subxt. If not, see <http://www.gnu.org/licenses/>.

use crate::{
events::EventsDecodingError,
metadata::{
InvalidMetadataError,
MetadataError,
},
use crate::metadata::{
InvalidMetadataError,
MetadataError,
};
use core::fmt::Debug;
use jsonrpsee::core::error::Error as RequestError;
use scale_value::scale::DecodeError;
use sp_core::crypto::SecretStringError;
use sp_runtime::transaction_validity::TransactionValidityError;

Expand Down Expand Up @@ -66,7 +64,7 @@ pub enum GenericError<E> {
Runtime(E),
/// Events decoding error.
#[error("Events decoding error: {0}")]
EventsDecoding(#[from] EventsDecodingError),
EventsDecoding(#[from] DecodeError),
/// Transaction progress error.
#[error("Transaction error: {0}")]
Transaction(#[from] TransactionError),
Expand Down
Loading

0 comments on commit 1e8d095

Please sign in to comment.