Skip to content

Commit

Permalink
Bump borsh to v1 (#210)
Browse files Browse the repository at this point in the history
* Bump borsh to v1

* Undo toml formatting

* Enable required `derive` feature of `borsh` and fix compilation issues

---------

Co-authored-by: Romain Ruetschi <[email protected]>
  • Loading branch information
seanchen1991 and romac authored May 29, 2024
1 parent e82245d commit e2211d9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ scale-info = { version = "2.1.2", default-features = false, features = [

## Optional: enabled by the `borsh` feature
## For borsh encode or decode, needs to track `anchor-lang` and `near-sdk-rs` borsh version
borsh = { version = "0.10", default-features = false, optional = true }
borsh = { version = "1", default-features = false, features = ["derive"], optional = true }

[dependencies.tendermint-proto]
version = "0.36"
Expand Down
9 changes: 2 additions & 7 deletions src/google.rs
Original file line number Diff line number Diff line change
Expand Up @@ -257,10 +257,7 @@ pub mod protobuf {

#[cfg(feature = "borsh")]
impl borsh::BorshSerialize for Any {
fn serialize<W: borsh::maybestd::io::Write>(
&self,
writer: &mut W,
) -> borsh::maybestd::io::Result<()> {
fn serialize<W: borsh::io::Write>(&self, writer: &mut W) -> borsh::io::Result<()> {
let inner_any = InnerAny {
type_url: self.type_url.clone(),
value: self.value.clone(),
Expand All @@ -272,9 +269,7 @@ pub mod protobuf {

#[cfg(feature = "borsh")]
impl borsh::BorshDeserialize for Any {
fn deserialize_reader<R: borsh::maybestd::io::Read>(
reader: &mut R,
) -> borsh::maybestd::io::Result<Self> {
fn deserialize_reader<R: borsh::io::Read>(reader: &mut R) -> borsh::io::Result<Self> {
let inner_any = InnerAny::deserialize_reader(reader)?;

Ok(Any {
Expand Down

0 comments on commit e2211d9

Please sign in to comment.