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

fix: set gateway address to a placeholder #30

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft

Conversation

fadeev
Copy link
Member

@fadeev fadeev commented Feb 13, 2025

With this placeholder, when I import the Gateway from an example project, it seems to compile fine:

[dependencies]
Sui = { git = "https://github.com/MystenLabs/sui.git", subdir = "crates/sui-framework/packages/sui-framework", rev = "framework/testnet" }
gateway = { git = "https://github.com/zeta-chain/protocol-contracts-sui.git", rev = "gateway-address" }

[addresses]
call = "0x0"
gateway = "0x2c8aa332520a3c3984c84c9acedeaee5421a327e031692530724b4f280516c8f"
module call::hello_world {
    use gateway::gateway::deposit;
    ///...
}

https://stackoverflow.com/questions/73958046/local-dependency-cannot-be-resolved/73959597

@fadeev
Copy link
Member Author

fadeev commented Feb 13, 2025

If I switch back to the main branch:

[dependencies]
Sui = { git = "https://github.com/MystenLabs/sui.git", subdir = "crates/sui-framework/packages/sui-framework", rev = "framework/testnet" }
gateway = { git = "https://github.com/zeta-chain/protocol-contracts-sui.git", rev = "main" }

[addresses]
call = "0x0"
gateway = "0x2c8aa332520a3c3984c84c9acedeaee5421a327e031692530724b4f280516c8f"

The build fails:

Failed to build Move modules: Processing dependency 'gateway' of 'call'

Caused by:
    Conflicting assignments for address 'gateway': '0x2c8aa332520a3c3984c84c9acedeaee5421a327e031692530724b4f280516c8f' and '0x0'..

@fadeev fadeev marked this pull request as ready for review February 13, 2025 08:06
@fadeev fadeev requested a review from a team as a code owner February 13, 2025 08:06
Copy link
Member

@lumtis lumtis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Running sui move test works
But running sui move build fails with

sui move build
UPDATING GIT DEPENDENCY https://github.com/MystenLabs/sui.git
Failed to build Move modules: Unresolved addresses found. To fix this, add an entry for each unresolved address to the [addresses] section of ./Move.toml: e.g.,

[addresses]
std = "0x1"

Alternatively, you can also define [dev-addresses] and call with the -d flag

Caused by:
    Unresolved addresses: [
      Named address 'gateway' in package 'gateway'
    ].

@fadeev
Copy link
Member Author

fadeev commented Feb 13, 2025

@lumtis can we use sui move build -d?

@fadeev fadeev marked this pull request as draft February 13, 2025 08:41
@lumtis
Copy link
Member

lumtis commented Feb 13, 2025

@lumtis can we use sui move build -d?

For the time being it might be fine

Compile in 'dev' mode. The 'dev-addresses' and 'dev-dependencies' fields will be used if this flag is set. This flag is useful for development of packages that expose named addresses that are not set to a specific value

But I'm not sure this will allow use to deploy the package in prod with this option.
Although when deploying in prod we can still change the move.toml

Copy link
Member

@lumtis lumtis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving now in case this unblock the localnet

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants