Skip to content

Commit

Permalink
replace cometbft with ostracon (#17)
Browse files Browse the repository at this point in the history
* fix: delete cometbft from submodules

* fix: add ostracon to submodules

* fix: replace cometbft with ostracon

* fix: run proto-build and regenerate the code

replace tendermint with ostracon

* fix: change the variable name from tendermint to ostracon

* fix: add submodule tendermint

* fix: add tendermint project

* fix: run packages/proto-build and generate code for tendermint project

* fix: add module tendermint

* style: cargo fmt

* fix: add tendermint
  • Loading branch information
Kynea0b authored Mar 14, 2024
1 parent 34657ff commit 4badc05
Show file tree
Hide file tree
Showing 22 changed files with 846 additions and 240 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/update-and-rebuild.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ jobs:
FINSCHIA_SDK_VERSION: ${{ steps.get_versions.outputs.FINSCHIA_SDK_VERSION }}
WASMD_VERSION: ${{ steps.get_versions.outputs.WASMD_VERSION }}
IBC_GO_VERSION: ${{ steps.get_versions.outputs.IBC_GO_VERSION }}
OSTRACON_VERSION: ${{ steps.get_versions.outputs.OSTRACON_VERSION }}
TENDERMINT_VERSION: ${{ steps.get_versions.outputs.TENDERMINT_VERSION }}
steps:
- name: Set current tag to env
Expand Down Expand Up @@ -43,10 +44,12 @@ jobs:
FINSCHIA_SDK_VERSION=$(grep 'github.com/Finschia/finschia-sdk' go.mod | awk '{print $2}' | awk -F '-' '{if ($3 != "") {print $3} else if ($2 != "") {print $1"-"$2} else {print $1}}')
WASMD_VERSION=$(grep 'github.com/Finschia/wasmd' go.mod | awk '{print $2}' | awk -F '-' '{if ($3 != "") {print $3} else if ($2 != "") {print $1"-"$2} else {print $1}}')
IBC_GO_VERSION=$(grep 'github.com/cosmos/ibc-go' go.mod | grep -v '=>' | awk '{print $2}' | awk -F '-' '{if ($3 != "") {print $3} else if ($2 != "") {print $1"-"$2} else {print $1}}')
OSTRACON_VERSION=$(grep 'github.com/Finschia/ostracon' go.mod | grep -v '=>' | awk '{print $2}' | awk -F '-' '{if ($3 != "") {print $3} else if ($2 != "") {print $1"-"$2} else {print $1}}')
TENDERMINT_VERSION=$(grep 'github.com/tendermint/tendermint' go.mod | grep -v '=>' | awk '{print $2}' | awk -F '-' '{if ($3 != "") {print $3} else if ($2 != "") {print $1"-"$2} else {print $1}}')
echo "NEW_TAG=${NEW_TAG}" >> $GITHUB_OUTPUT
echo "FINSCHIA_SDK_VERSION=$FINSCHIA_SDK_VERSION" >> $GITHUB_OUTPUT
echo "WASMD_VERSION=$WASMD_VERSION" >> $GITHUB_OUTPUT
echo "OSTRACON_VERSION=$OSTRACON_VERSION" >> $GITHUB_OUTPUT
echo "TENDERMINT_VERSION=$TENDERMINT_VERSION" >> $GITHUB_OUTPUT
echo "IBC_GO_VERSION=$IBC_GO_VERSION" >> $GITHUB_OUTPUT
Expand All @@ -59,6 +62,7 @@ jobs:
FINSCHIA_SDK_VERSION: ${{ needs.check-new-finschia-tag.outputs.FINSCHIA_SDK_VERSION }}
WASMD_VERSION: ${{ needs.check-new-finschia-tag.outputs.WASMD_VERSION }}
IBC_GO_VERSION: ${{ needs.check-new-finschia-tag.outputs.IBC_GO_VERSION }}
OSTRACON_VERSION: ${{ needs.check-new-finschia-tag.outputs.OSTRACON_VERSION }}
TENDERMINT_VERSION: ${{ needs.check-new-finschia-tag.outputs.TENDERMINT_VERSION }}

steps:
Expand Down Expand Up @@ -96,6 +100,7 @@ jobs:
echo FINSCHIA_VERSION=${{ env.NEW_TAG }} >> env
echo FINSCHIA_SDK_VERSION=${{ env.FINSCHIA_SDK_VERSION }} >> env
echo WASMD_VERSION=${{ env.WASMD_VERSION }} >> env
echo OSTRACON_VERSION=${{ env.OSTRACON_VERSION }} >> env
echo TENDERMINT_VERSION=${{ env.TENDERMINT_VERSION }} >> env
echo IBC_GO_VERSION=${{ env.IBC_GO_VERSION }} >> env
Expand Down
9 changes: 6 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
[submodule "dependencies/cometbft"]
path = dependencies/cometbft
url = https://github.com/cometbft/cometbft.git
[submodule "dependencies/ibc-go"]
path = dependencies/ibc-go
url = https://github.com/cosmos/ibc-go.git
Expand All @@ -13,3 +10,9 @@
[submodule "dependencies/finschia-sdk"]
path = dependencies/finschia-sdk
url = https://github.com/Finschia/finschia-sdk.git
[submodule "dependencies/ostracon"]
path = dependencies/ostracon
url = https://github.com/Finschia/ostracon.git
[submodule "dependencies/tendermint"]
path = dependencies/tendermint
url = https://github.com/tendermint/tendermint.git
1 change: 0 additions & 1 deletion dependencies/cometbft
Submodule cometbft deleted from fe4548
1 change: 1 addition & 0 deletions dependencies/ostracon
Submodule ostracon added at 08c34d
1 change: 1 addition & 0 deletions dependencies/tendermint
Submodule tendermint added at 35581c
3 changes: 2 additions & 1 deletion env
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
FINSCHIA_SDK_VERSION="v0.48.1"
WASMD_VERSION="v0.2.0"
TENDERMINT_VERSION="v0.37.2"
OSTRACON_VERSION="v1.1.2"
TENDERMINT_VERSION="v0.34.24"
IBC_GO_VERSION="v7.3.1"
ICS23_VERSION="rust/v0.10.0"
1 change: 1 addition & 0 deletions packages/finschia-std/src/types/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ pub mod cosmos;
pub mod cosmwasm;
pub mod ibc;
pub mod lbm;
pub mod ostracon;
pub mod tendermint;
310 changes: 310 additions & 0 deletions packages/finschia-std/src/types/ostracon/abci.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,310 @@
use finschia_std_derive::CosmwasmExt;
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
Clone,
PartialEq,
Eq,
::prost::Message,
::serde::Serialize,
::serde::Deserialize,
::schemars::JsonSchema,
CosmwasmExt,
)]
#[proto_message(type_url = "/ostracon.abci.Request")]
pub struct Request {
#[prost(
oneof = "request::Value",
tags = "1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 1000, 1001"
)]
pub value: ::core::option::Option<request::Value>,
}
/// Nested message and enum types in `Request`.
pub mod request {
use finschia_std_derive::CosmwasmExt;
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
Clone,
PartialEq,
Eq,
::prost::Oneof,
::serde::Serialize,
::serde::Deserialize,
::schemars::JsonSchema,
)]
pub enum Value {
#[prost(message, tag = "1")]
Echo(super::super::super::tendermint::abci::RequestEcho),
#[prost(message, tag = "2")]
Flush(super::super::super::tendermint::abci::RequestFlush),
#[prost(message, tag = "3")]
Info(super::super::super::tendermint::abci::RequestInfo),
#[prost(message, tag = "4")]
SetOption(super::super::super::tendermint::abci::RequestSetOption),
#[prost(message, tag = "5")]
InitChain(super::super::super::tendermint::abci::RequestInitChain),
#[prost(message, tag = "6")]
Query(super::super::super::tendermint::abci::RequestQuery),
#[prost(message, tag = "7")]
BeginBlock(super::RequestBeginBlock),
#[prost(message, tag = "8")]
CheckTx(super::super::super::tendermint::abci::RequestCheckTx),
#[prost(message, tag = "9")]
DeliverTx(super::super::super::tendermint::abci::RequestDeliverTx),
#[prost(message, tag = "10")]
EndBlock(super::super::super::tendermint::abci::RequestEndBlock),
#[prost(message, tag = "11")]
Commit(super::super::super::tendermint::abci::RequestCommit),
#[prost(message, tag = "12")]
ListSnapshots(super::super::super::tendermint::abci::RequestListSnapshots),
#[prost(message, tag = "13")]
OfferSnapshot(super::super::super::tendermint::abci::RequestOfferSnapshot),
#[prost(message, tag = "14")]
LoadSnapshotChunk(super::super::super::tendermint::abci::RequestLoadSnapshotChunk),
#[prost(message, tag = "15")]
ApplySnapshotChunk(super::super::super::tendermint::abci::RequestApplySnapshotChunk),
/// 16~99 are reserved for merging original tendermint
#[prost(message, tag = "1000")]
BeginRecheckTx(super::RequestBeginRecheckTx),
#[prost(message, tag = "1001")]
EndRecheckTx(super::RequestEndRecheckTx),
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
Clone,
PartialEq,
Eq,
::prost::Message,
::serde::Serialize,
::serde::Deserialize,
::schemars::JsonSchema,
CosmwasmExt,
)]
#[proto_message(type_url = "/ostracon.abci.RequestBeginBlock")]
pub struct RequestBeginBlock {
#[prost(bytes = "vec", tag = "1")]
#[serde(
serialize_with = "crate::serde::as_base64_encoded_string::serialize",
deserialize_with = "crate::serde::as_base64_encoded_string::deserialize"
)]
pub hash: ::prost::alloc::vec::Vec<u8>,
#[prost(message, optional, tag = "2")]
pub header: ::core::option::Option<super::super::tendermint::types::Header>,
#[prost(message, optional, tag = "3")]
pub last_commit_info: ::core::option::Option<super::super::tendermint::abci::LastCommitInfo>,
#[prost(message, repeated, tag = "4")]
pub byzantine_validators: ::prost::alloc::vec::Vec<super::super::tendermint::abci::Evidence>,
/// *** Ostracon Extended Fields ***
#[prost(message, optional, tag = "1000")]
pub entropy: ::core::option::Option<super::types::Entropy>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
Clone,
PartialEq,
Eq,
::prost::Message,
::serde::Serialize,
::serde::Deserialize,
::schemars::JsonSchema,
CosmwasmExt,
)]
#[proto_message(type_url = "/ostracon.abci.RequestBeginRecheckTx")]
pub struct RequestBeginRecheckTx {
#[prost(message, optional, tag = "1")]
pub header: ::core::option::Option<super::super::tendermint::types::Header>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
Clone,
PartialEq,
Eq,
::prost::Message,
::serde::Serialize,
::serde::Deserialize,
::schemars::JsonSchema,
CosmwasmExt,
)]
#[proto_message(type_url = "/ostracon.abci.RequestEndRecheckTx")]
pub struct RequestEndRecheckTx {
#[prost(int64, tag = "1")]
#[serde(
serialize_with = "crate::serde::as_str::serialize",
deserialize_with = "crate::serde::as_str::deserialize"
)]
pub height: i64,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
Clone,
PartialEq,
Eq,
::prost::Message,
::serde::Serialize,
::serde::Deserialize,
::schemars::JsonSchema,
CosmwasmExt,
)]
#[proto_message(type_url = "/ostracon.abci.Response")]
pub struct Response {
#[prost(
oneof = "response::Value",
tags = "1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 1000, 1001"
)]
pub value: ::core::option::Option<response::Value>,
}
/// Nested message and enum types in `Response`.
pub mod response {
use finschia_std_derive::CosmwasmExt;
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
Clone,
PartialEq,
Eq,
::prost::Oneof,
::serde::Serialize,
::serde::Deserialize,
::schemars::JsonSchema,
)]
pub enum Value {
#[prost(message, tag = "1")]
Exception(super::super::super::tendermint::abci::ResponseException),
#[prost(message, tag = "2")]
Echo(super::super::super::tendermint::abci::ResponseEcho),
#[prost(message, tag = "3")]
Flush(super::super::super::tendermint::abci::ResponseFlush),
#[prost(message, tag = "4")]
Info(super::super::super::tendermint::abci::ResponseInfo),
#[prost(message, tag = "5")]
SetOption(super::super::super::tendermint::abci::ResponseSetOption),
#[prost(message, tag = "6")]
InitChain(super::super::super::tendermint::abci::ResponseInitChain),
#[prost(message, tag = "7")]
Query(super::super::super::tendermint::abci::ResponseQuery),
#[prost(message, tag = "8")]
BeginBlock(super::super::super::tendermint::abci::ResponseBeginBlock),
#[prost(message, tag = "9")]
CheckTx(super::ResponseCheckTx),
#[prost(message, tag = "10")]
DeliverTx(super::super::super::tendermint::abci::ResponseDeliverTx),
#[prost(message, tag = "11")]
EndBlock(super::super::super::tendermint::abci::ResponseEndBlock),
#[prost(message, tag = "12")]
Commit(super::super::super::tendermint::abci::ResponseCommit),
#[prost(message, tag = "13")]
ListSnapshots(super::super::super::tendermint::abci::ResponseListSnapshots),
#[prost(message, tag = "14")]
OfferSnapshot(super::super::super::tendermint::abci::ResponseOfferSnapshot),
#[prost(message, tag = "15")]
LoadSnapshotChunk(super::super::super::tendermint::abci::ResponseLoadSnapshotChunk),
#[prost(message, tag = "16")]
ApplySnapshotChunk(super::super::super::tendermint::abci::ResponseApplySnapshotChunk),
/// 17~99 are reserved for merging original tendermint
#[prost(message, tag = "1000")]
BeginRecheckTx(super::ResponseBeginRecheckTx),
#[prost(message, tag = "1001")]
EndRecheckTx(super::ResponseEndRecheckTx),
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
Clone,
PartialEq,
Eq,
::prost::Message,
::serde::Serialize,
::serde::Deserialize,
::schemars::JsonSchema,
CosmwasmExt,
)]
#[proto_message(type_url = "/ostracon.abci.ResponseCheckTx")]
pub struct ResponseCheckTx {
#[prost(uint32, tag = "1")]
#[serde(
serialize_with = "crate::serde::as_str::serialize",
deserialize_with = "crate::serde::as_str::deserialize"
)]
pub code: u32,
#[prost(bytes = "vec", tag = "2")]
#[serde(
serialize_with = "crate::serde::as_base64_encoded_string::serialize",
deserialize_with = "crate::serde::as_base64_encoded_string::deserialize"
)]
pub data: ::prost::alloc::vec::Vec<u8>,
/// nondeterministic
#[prost(string, tag = "3")]
pub log: ::prost::alloc::string::String,
/// nondeterministic
#[prost(string, tag = "4")]
pub info: ::prost::alloc::string::String,
#[prost(int64, tag = "5")]
#[serde(
serialize_with = "crate::serde::as_str::serialize",
deserialize_with = "crate::serde::as_str::deserialize"
)]
pub gas_wanted: i64,
#[prost(int64, tag = "6")]
#[serde(
serialize_with = "crate::serde::as_str::serialize",
deserialize_with = "crate::serde::as_str::deserialize"
)]
pub gas_used: i64,
#[prost(message, repeated, tag = "7")]
pub events: ::prost::alloc::vec::Vec<super::super::tendermint::abci::Event>,
#[prost(string, tag = "8")]
pub codespace: ::prost::alloc::string::String,
/// MEMO: not used, just reservation to implement <https://github.com/tendermint/tendermint/pull/6740> first
#[prost(string, tag = "9")]
pub sender: ::prost::alloc::string::String,
/// MEMO: not used, just reservation to implement <https://github.com/tendermint/tendermint/pull/6740> first
#[prost(int64, tag = "10")]
#[serde(
serialize_with = "crate::serde::as_str::serialize",
deserialize_with = "crate::serde::as_str::deserialize"
)]
pub priority: i64,
/// mempool_error is set by Ostracon.
/// ABCI applictions creating a ResponseCheckTX should not set mempool_error.
#[prost(string, tag = "11")]
pub mempool_error: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
Clone,
PartialEq,
Eq,
::prost::Message,
::serde::Serialize,
::serde::Deserialize,
::schemars::JsonSchema,
CosmwasmExt,
)]
#[proto_message(type_url = "/ostracon.abci.ResponseBeginRecheckTx")]
pub struct ResponseBeginRecheckTx {
#[prost(uint32, tag = "1")]
#[serde(
serialize_with = "crate::serde::as_str::serialize",
deserialize_with = "crate::serde::as_str::deserialize"
)]
pub code: u32,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(
Clone,
PartialEq,
Eq,
::prost::Message,
::serde::Serialize,
::serde::Deserialize,
::schemars::JsonSchema,
CosmwasmExt,
)]
#[proto_message(type_url = "/ostracon.abci.ResponseEndRecheckTx")]
pub struct ResponseEndRecheckTx {
#[prost(uint32, tag = "1")]
#[serde(
serialize_with = "crate::serde::as_str::serialize",
deserialize_with = "crate::serde::as_str::deserialize"
)]
pub code: u32,
}
Loading

0 comments on commit 4badc05

Please sign in to comment.