Skip to content

Commit

Permalink
Merge pull request #16 from kevinheavey/missing-getters
Browse files Browse the repository at this point in the history
Missing getters
  • Loading branch information
kevinheavey authored Oct 10, 2022
2 parents 25c8aee + 26c7336 commit 8fd21d1
Show file tree
Hide file tree
Showing 7 changed files with 70 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 0.8.0
current_version = 0.8.1
commit = True
tag = False

Expand Down
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Changelog

## [0.8.1] - 2022-10-10

### Fixed

- Add missing getters to `UiTransactionStatusMeta` [(#16)](https://github.com/kevinheavey/solders/pull/16)


## [0.8.0] - 2022-10-10

### Changed
Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "solders"
version = "0.8.0"
version = "0.8.1"
edition = "2021"
include = ["/src", "/LICENSE", "/pyproject.toml"]
description = "Python binding to the Solana Rust SDK"
Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
author = "Kevin Heavey"

# The full version, including alpha/beta/rc tags
release = "0.8.0"
release = "0.8.1"


# -- General configuration ---------------------------------------------------
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "solders"
version = "0.8.0"
version = "0.8.1"
description = "Python bindings for Solana Rust tools"
authors = ["kevinheavey <kevinheavey123@gmail.com>"]
license = "Apache"
Expand Down Expand Up @@ -29,7 +29,7 @@ build-backend = "maturin"

[project]
name = "solders"
version = "0.8.0"
version = "0.8.1"
description = "Python binding to the Solana Rust SDK"
authors = [ {name = "kevinheavey", email = "kevinheavey123@gmail.com"} ]
license = {file = "LICENSE"}
Expand Down
57 changes: 57 additions & 0 deletions src/transaction_status.rs
Original file line number Diff line number Diff line change
Expand Up @@ -853,6 +853,63 @@ impl UiTransactionStatusMeta {
}
.into()
}

#[getter]
pub fn err(&self) -> Option<TransactionErrorType> {
self.0.err.clone().map(|e| e.into())
}
#[getter]
pub fn fee(&self) -> u64 {
self.0.fee
}
#[getter]
pub fn pre_balances(&self) -> Vec<u64> {
self.0.pre_balances.clone()
}
#[getter]
pub fn post_balances(&self) -> Vec<u64> {
self.0.post_balances.clone()
}
#[getter]
pub fn inner_instructions(&self) -> Option<Vec<UiInnerInstructions>> {
self.0
.inner_instructions
.clone()
.map(|v| v.into_iter().map(|ix| ix.into()).collect())
}
#[getter]
pub fn log_messages(&self) -> Option<Vec<String>> {
self.0.log_messages.clone()
}
#[getter]
pub fn pre_token_balances(&self) -> Option<Vec<UiTransactionTokenBalance>> {
self.0
.pre_token_balances
.clone()
.map(|v| v.into_iter().map(|bal| bal.into()).collect())
}
#[getter]
pub fn post_token_balances(&self) -> Option<Vec<UiTransactionTokenBalance>> {
self.0
.post_token_balances
.clone()
.map(|v| v.into_iter().map(|bal| bal.into()).collect())
}
#[getter]
pub fn rewards(&self) -> Option<Rewards> {
self.0
.rewards
.clone()
.map(|v| v.into_iter().map(|r| r.into()).collect())
}
#[getter]
pub fn loaded_addresses(&self) -> Option<UiLoadedAddresses> {
self.0.loaded_addresses.clone().map(|a| a.into())
}
#[getter]
pub fn return_data(&self) -> Option<TransactionReturnData> {
self.0.return_data.clone().map(|r| r.into())
}
}

#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, From, Into)]
Expand Down

0 comments on commit 8fd21d1

Please sign in to comment.