Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(its)!: changed from trusted addresses to trusted chains #235

Merged
merged 34 commits into from
Jan 28, 2025
Merged
Changes from 1 commit
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
63beb53
changed from trusted addresses to trusted chains
Foivos Jan 20, 2025
7ac8025
fixed some tests
Foivos Jan 20, 2025
46e65b2
rename some stuff
Foivos Jan 20, 2025
1bf88f1
fix some tests
Foivos Jan 20, 2025
eb43639
fix tests
Foivos Jan 20, 2025
663bbef
fix move tests
Foivos Jan 21, 2025
fcb0cc2
add a creator cap and setup to its
Foivos Jan 21, 2025
9f3c157
add chain name to token_id derivation
Foivos Jan 21, 2025
f335d89
prettier and fix interfaces
Foivos Jan 22, 2025
2a4cab6
Merge remote-tracking branch 'origin/main' into feat/remove-address-t…
Foivos Jan 23, 2025
d1e8ddd
address a few comments
Foivos Jan 23, 2025
27150a8
rename chain_tracker to trusted_chains
Foivos Jan 23, 2025
a3aa2a7
some more comments addressed
Foivos Jan 23, 2025
b8d1e51
Update move/squid/sources/squid/squid.move
Foivos Jan 23, 2025
5c5f184
address some more comments
Foivos Jan 23, 2025
1e47517
addressed a comments
Foivos Jan 23, 2025
e5d2b81
Merge remote-tracking branch 'origin/main' into feat/token-id-chain-d…
Foivos Jan 23, 2025
577f190
Merge branch 'feat/token-id-chain-derivation' into feat/remove-addres…
Foivos Jan 23, 2025
1b76acc
fix tests
Foivos Jan 23, 2025
f65bd68
add its_hub_address as a variable
Foivos Jan 23, 2025
e9f0c72
changed how wrap payload works
Foivos Jan 23, 2025
73ff042
changed pattern for wrapping payload a bit.
Foivos Jan 23, 2025
c5b8d37
Update move/interchain_token_service/sources/types/trusted_chains.move
Foivos Jan 27, 2025
82d091c
Update move/interchain_token_service/sources/types/trusted_chains.move
Foivos Jan 27, 2025
98e1163
Update move/interchain_token_service/sources/types/trusted_chains.move
Foivos Jan 27, 2025
9b987a4
rename `prepare_wrapped_message` to `prepare_hub_message`
Foivos Jan 27, 2025
bff94bd
cs
Foivos Jan 27, 2025
2db608a
added explicit check that chain is contained when trying to remove it.
Foivos Jan 27, 2025
9716566
Merge remote-tracking branch 'origin/main' into feat/remove-address-t…
Foivos Jan 27, 2025
7c2cadb
fix tests
Foivos Jan 27, 2025
6c406fd
Merge remote-tracking branch 'origin/main' into feat/remove-address-t…
Foivos Jan 27, 2025
02915b7
update bcs
Foivos Jan 27, 2025
d780bc9
update bcs test for InterchainTokenServiceV0
Foivos Jan 27, 2025
4172de7
made lint happy
Foivos Jan 28, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
add chain name to token_id derivation
Foivos committed Jan 21, 2025
commit 9f3c157a82f8fbd9e6e0bf6ca72489349e71ec32
4 changes: 4 additions & 0 deletions move/interchain_token_service/sources/types/token_id.move
Original file line number Diff line number Diff line change
@@ -34,6 +34,7 @@ public fun to_u256(token_id: &TokenId): u256 {
}

public fun from_info<T>(
chain_name: &ascii::String,
name: &String,
symbol: &ascii::String,
decimals: &u8,
@@ -42,6 +43,7 @@ public fun from_info<T>(
): TokenId {
let mut vec = address::from_u256(PREFIX_SUI_TOKEN_ID).to_bytes();
vec.append(bcs::to_bytes(&type_name::get<T>()));
vec.append(bcs::to_bytes(chain_name));
vec.append(bcs::to_bytes(name));
vec.append(bcs::to_bytes(symbol));
vec.append(bcs::to_bytes(decimals));
@@ -51,10 +53,12 @@ public fun from_info<T>(
}

public(package) fun from_coin_data<T>(
chain_name: &ascii::String,
coin_info: &CoinInfo<T>,
coin_management: &CoinManagement<T>,
): TokenId {
from_info<T>(
chain_name,
&coin_info.name(),
&coin_info.symbol(),
&coin_info.decimals(),
Original file line number Diff line number Diff line change
@@ -201,7 +201,7 @@ public(package) fun register_coin<T>(
coin_info: CoinInfo<T>,
coin_management: CoinManagement<T>,
): TokenId {
let token_id = token_id::from_coin_data(&coin_info, &coin_management);
let token_id = token_id::from_coin_data(self.chain_name(), &coin_info, &coin_management);

self.add_registered_coin(token_id, coin_management, coin_info);

@@ -493,8 +493,8 @@ public(package) fun disallow_function(
self.version_control.disallow_function(version, function_name);
}

public(package) fun chain_name(self: &InterchainTokenService_v0): String {
self.chain_name
public(package) fun chain_name(self: &InterchainTokenService_v0): &String {
&self.chain_name
}

// -----------------