Skip to content

Commit

Permalink
refactor(proof): use vector::tabulate macro (#133)
Browse files Browse the repository at this point in the history
  • Loading branch information
npty authored Sep 11, 2024
1 parent b0cb54e commit 7f36eea
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 11 deletions.
5 changes: 5 additions & 0 deletions .changeset/honest-baboons-act.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@axelar-network/axelar-cgp-sui': patch
---

chore: refactor proof module
13 changes: 2 additions & 11 deletions move/axelar_gateway/sources/types/proof.move
Original file line number Diff line number Diff line change
Expand Up @@ -68,20 +68,11 @@ public(package) fun peel_signature(bcs: &mut BCS): Signature {

public(package) fun peel(bcs: &mut BCS): Proof {
let signers = weighted_signers::peel(bcs);

let mut signatures = vector::empty<Signature>();

let mut length = bcs.peel_vec_length();

while (length > 0) {
signatures.push_back(peel_signature(bcs));

length = length - 1;
};
let length = bcs.peel_vec_length();

Proof {
signers,
signatures,
signatures: vector::tabulate!(length, |_| peel_signature(bcs)),
}
}

Expand Down

0 comments on commit 7f36eea

Please sign in to comment.