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

Add set local chainId Action #69

Merged
merged 2 commits into from
Nov 11, 2024
Merged

Add set local chainId Action #69

merged 2 commits into from
Nov 11, 2024

Conversation

envin3
Copy link
Contributor

@envin3 envin3 commented Nov 10, 2024

add set local chain id action.
local chain id isn't hardcoded anymore.

@envin3 envin3 requested a review from gitmp01 November 10, 2024 22:05
@envin3 envin3 linked an issue Nov 10, 2024 that may be closed by this pull request
@envin3 envin3 changed the title Feat/set local chainid Add set local chainId Action Nov 10, 2024
@envin3 envin3 force-pushed the feat/set-local-chainid branch from e68420f to b36e8df Compare November 10, 2024 22:08
Copy link
Collaborator

@gitmp01 gitmp01 left a comment

Choose a reason for hiding this comment

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

Thanks for taking care of this, good job!

@@ -77,7 +75,12 @@ namespace eosio {
// +----------- context ---------+------------- event ---------------+
check(context_checks(operation, metadata), "unexpected context");

chain_id _chain_id(adapter, adapter.value);
check(_chain_id.exists(), "local chain id singleton not set");
Copy link
Collaborator

Choose a reason for hiding this comment

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

👍

@@ -148,7 +151,7 @@ namespace eosio {

bytes dest_chain_id = extract_32bytes(event_data, offset);
check(operation.destinationChainId == dest_chain_id, "destination chain id does not match with the expected one");
check(CHAIN_ID == dest_chain_id, "destination chain id does not match with the current chain");
check(local_chain_id == dest_chain_id, "destination chain id does not match with the current chain");
Copy link
Collaborator

Choose a reason for hiding this comment

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

👍

@gitmp01 gitmp01 merged commit 5fba184 into master Nov 11, 2024
1 check passed
@gitmp01 gitmp01 deleted the feat/set-local-chainid branch November 11, 2024 09:11
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.

Add action setchainid in order to set the local chain id in the contract
2 participants