Skip to content

Commit

Permalink
fix: lint
Browse files Browse the repository at this point in the history
  • Loading branch information
frdomovic committed Dec 19, 2024
1 parent 984a95e commit bc7701f
Showing 1 changed file with 18 additions and 13 deletions.
31 changes: 18 additions & 13 deletions crates/context/config/src/client/env/proxy/types/starknet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -350,19 +350,24 @@ impl From<Vec<ProposalAction>> for StarknetProposalActionWithArgs {
impl From<StarknetProposalActionWithArgs> for ProposalAction {
fn from(action: StarknetProposalActionWithArgs) -> Self {
match action {
StarknetProposalActionWithArgs::ExternalFunctionCall(contract, selector, calldata, _) => {
ProposalAction::ExternalFunctionCall {
receiver_id: format!("0x{}", hex::encode(contract.to_bytes_be())),
method_name: format!("0x{}", hex::encode(selector.to_bytes_be())),
args: calldata
.0.high.to_bytes_be()
.chunks(32)
.map(|bytes| format!("0x{}", hex::encode(bytes)))
.collect::<Vec<_>>()
.join(","),
deposit: 0,
}
}
StarknetProposalActionWithArgs::ExternalFunctionCall(
contract,
selector,
calldata,
_,
) => ProposalAction::ExternalFunctionCall {
receiver_id: format!("0x{}", hex::encode(contract.to_bytes_be())),
method_name: format!("0x{}", hex::encode(selector.to_bytes_be())),
args: calldata
.0
.high
.to_bytes_be()
.chunks(32)
.map(|bytes| format!("0x{}", hex::encode(bytes)))
.collect::<Vec<_>>()
.join(","),
deposit: 0,
},
StarknetProposalActionWithArgs::Transfer(receiver, amount) => {
let FeltPair { high, low } = amount.0;
ProposalAction::Transfer {
Expand Down

0 comments on commit bc7701f

Please sign in to comment.