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

Register Operations logic #26

Merged
merged 27 commits into from
Feb 20, 2024
Merged

Register Operations logic #26

merged 27 commits into from
Feb 20, 2024

Conversation

andreiblt1304
Copy link
Contributor

No description provided.

multisigverifier/src/lib.rs Outdated Show resolved Hide resolved
multisigverifier/src/lib.rs Outdated Show resolved Hide resolved
multisigverifier/src/lib.rs Outdated Show resolved Hide resolved
multisigverifier/src/lib.rs Outdated Show resolved Hide resolved
@andreiblt1304 andreiblt1304 changed the title Register and Execute Operations logic Register Operations logic Feb 16, 2024
Copy link

github-actions bot commented Feb 16, 2024

Contract comparison - from 932feb2 to 5391e54

Path                                                                                             size                  has-allocator                     has-format
mx-sovereign-sc
- chain-config/chain-config.wasm 6697 No No
- chain-factory/chain-factory.wasm 5608 No No
- esdt-safe/esdt-safe.wasm 41505 No No
- fee-market/fee-market.wasm 12359 No No
- multisigverifier/multisigverifier.wasm N/A ➡️ 5475 ⚠️ N/A ➡️ No ⚠️ N/A ➡️ No ⚠️

Comment on lines 43 to 64
require!(
is_bls_valid,
"BLS signature is not valid"
);
Copy link
Contributor

Choose a reason for hiding this comment

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

Do this check right after the verify_bls call, no need to process further if that fails.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

Comment on lines 77 to 81
if is_bls_valid && signatures_count > minimum_signatures {
return true
}

false
Copy link
Contributor

Choose a reason for hiding this comment

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

Can simply return the condition. i.e.

is_bls_valid && signatures_count > minimum_signatures

Having said that, I wouldn't give a bool arg to this function just to check if it's true, I'd just check it outside the function.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

Choose a reason for hiding this comment

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

Remove empty file


let bridge_operations_hash = "6ee1e00813a74f8293d2c63172c062d38bf780d8811ff63984813a49cd61ff9e";
let mock_signature: BlsSignature<StaticApi> = ManagedByteArray::new_from_bytes(
b"EIZ2\x05\xf7q\xc7G\x96\x1f\xba0\xe2\xd1\xf5pE\x14\xd7?\xac\xff\x8d\x1a\x0c\x11\x900f5\xfb\xff4\x94\xb8@\xc5^\xc2,exn0\xe3\xf0\n"

Choose a reason for hiding this comment

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

How did you get this magic signature? Would be useful to compute it here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I tried using methods from the SDK but couldn't find the correct steps

@andreiblt1304 andreiblt1304 marked this pull request as ready for review February 20, 2024 06:50
@@ -0,0 +1,106 @@
#![no_std]

use core::ptr::null;
Copy link
Contributor

Choose a reason for hiding this comment

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

clippy: unused import

Copy link
Contributor Author

Choose a reason for hiding this comment

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

resolving more clippy warning right now

@sasurobert sasurobert merged commit 5cb20d2 into main Feb 20, 2024
5 checks passed
@CostinCarabas CostinCarabas deleted the multisig branch February 20, 2024 08:15
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.

5 participants