Skip to content

Commit 744f29d

Browse files
committed
Rename CodeChain to Foundry in the ibc directory
1 parent d973e02 commit 744f29d

File tree

5 files changed

+19
-19
lines changed

5 files changed

+19
-19
lines changed

core/src/ibc/client_02/codechain/mod.rs renamed to core/src/ibc/client_02/foundry/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2019 Kodebox, Inc.
1+
// Copyright 2019-2020 Kodebox, Inc.
22
// This file is part of CodeChain.
33
//
44
// This program is free software: you can redistribute it and/or modify

core/src/ibc/client_02/codechain/types.rs renamed to core/src/ibc/client_02/foundry/types.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2019 Kodebox, Inc.
1+
// Copyright 2019-2020 Kodebox, Inc.
22
// This file is part of CodeChain.
33
//
44
// This program is free software: you can redistribute it and/or modify
@@ -18,7 +18,7 @@ use crate::encoded;
1818
use crate::ibc;
1919
use ckey::Public;
2020
use ibc::client_02 as client;
21-
use ibc::client_02::{type_path, Header as ClientHeader, Kind, KIND_CODECHAIN};
21+
use ibc::client_02::{type_path, Header as ClientHeader, Kind, KIND_FOUNDRY};
2222
use ibc::commitment_23 as commitment;
2323
use ibc::KVStore;
2424
use primitives::H256;
@@ -68,7 +68,7 @@ impl ConsensusState {
6868

6969
impl client::ConsensusState for ConsensusState {
7070
fn kind(&self) -> u8 {
71-
client::KIND_CODECHAIN
71+
client::KIND_FOUNDRY
7272
}
7373

7474
fn get_height(&self) -> u64 {
@@ -123,7 +123,7 @@ impl Header {
123123

124124
impl client::Header for Header {
125125
fn kind(&self) -> u8 {
126-
client::KIND_CODECHAIN
126+
client::KIND_FOUNDRY
127127
}
128128
fn get_height(&self) -> u64 {
129129
self.raw.number()
@@ -157,7 +157,7 @@ impl State {
157157
}
158158

159159
fn kind(&self) -> Kind {
160-
KIND_CODECHAIN
160+
KIND_FOUNDRY
161161
}
162162

163163
fn set_type(&self, ctx: &mut dyn ibc::Context) {

core/src/ibc/client_02/mod.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2019 Kodebox, Inc.
1+
// Copyright 2019-2020 Kodebox, Inc.
22
// This file is part of CodeChain.
33
//
44
// This program is free software: you can redistribute it and/or modify
@@ -14,24 +14,24 @@
1414
// You should have received a copy of the GNU Affero General Public License
1515
// along with this program. If not, see <https://www.gnu.org/licenses/>.
1616

17-
pub mod codechain;
17+
pub mod foundry;
1818
mod manager;
1919
mod types;
2020

2121
pub use self::manager::Manager;
22-
pub use self::types::{ConsensusState, Header, Kind, State, KIND_CODECHAIN};
22+
pub use self::types::{ConsensusState, Header, Kind, State, KIND_FOUNDRY};
2323
use crate::ibc;
2424

2525
fn new_state(id: &str, ctx: &mut dyn ibc::Context, client_type: Kind) -> Box<dyn State> {
26-
if client_type == KIND_CODECHAIN {
27-
Box::new(codechain::State::new(id, ctx))
26+
if client_type == KIND_FOUNDRY {
27+
Box::new(foundry::State::new(id, ctx))
2828
} else {
2929
panic!("Invalid client type");
3030
}
3131
}
3232

3333
fn get_state(id: &str, ctx: &mut dyn ibc::Context) -> Result<Box<dyn State>, String> {
34-
let s = codechain::State::find(id);
34+
let s = foundry::State::find(id);
3535
if s.exists(ctx) {
3636
Ok(Box::new(s))
3737
} else {

core/src/ibc/client_02/types.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2019 Kodebox, Inc.
1+
// Copyright 2019-2020 Kodebox, Inc.
22
// This file is part of CodeChain.
33
//
44
// This program is free software: you can redistribute it and/or modify
@@ -34,7 +34,7 @@ pub trait Header {
3434
fn encode(&self) -> &[u8];
3535
}
3636

37-
pub const KIND_CODECHAIN: Kind = 0_u8;
37+
pub const KIND_FOUNDRY: Kind = 0_u8;
3838

3939
pub trait State {
4040
fn get_consensus_state(&self, ctx: &mut dyn ibc::Context) -> Box<dyn ConsensusState>;

core/src/ibc/custom_action_handler/mod.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2019 Kodebox, Inc.
1+
// Copyright 2019-2020 Kodebox, Inc.
22
// This file is part of CodeChain.
33
//
44
// This program is free software: you can redistribute it and/or modify
@@ -25,7 +25,7 @@ use ctypes::errors::RuntimeError;
2525
use ctypes::errors::SyntaxError;
2626
use ctypes::{CommonParams, Header};
2727
use ibc::client_02 as ibc_client;
28-
use ibc::client_02::codechain as ibc_codechain;
28+
use ibc::client_02::foundry as ibc_foundry;
2929
use ibc::context as ibc_context;
3030
use parking_lot::RwLock;
3131
use rlp::{Decodable, Rlp};
@@ -105,19 +105,19 @@ fn create_client(
105105
) -> StateResult<()> {
106106
let mut context = ibc_context::TopLevelContext::new(state);
107107
let client_manager = ibc_client::Manager::new();
108-
if kind != ibc_client::KIND_CODECHAIN {
108+
if kind != ibc_client::KIND_FOUNDRY {
109109
return Err(RuntimeError::IBC(format!("CreateClient has invalid type {}", kind)).into())
110110
}
111111
let rlp = rlp::Rlp::new(consensus_state);
112-
let codechain_consensus_state: ibc_codechain::ConsensusState = match rlp.as_val() {
112+
let foundry_consensus_state: ibc_foundry::ConsensusState = match rlp.as_val() {
113113
Ok(cs) => cs,
114114
Err(err) => {
115115
return Err(RuntimeError::IBC(format!("CreateClient failed to decode consensus state {}", err)).into())
116116
}
117117
};
118118

119119
client_manager
120-
.create(&mut context, id, &codechain_consensus_state)
120+
.create(&mut context, id, &foundry_consensus_state)
121121
.map_err(|err| RuntimeError::IBC(format!("CreateClient: {:?}", err)))?;
122122
Ok(())
123123
}

0 commit comments

Comments
 (0)