Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
sudo-shashank committed May 9, 2024
1 parent 0819f6f commit 489ae50
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/rpc/methods/msig.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use crate::rpc::{ApiVersion, Ctx, Permission, RpcMethod};
use crate::shim::{address::Address, econ::TokenAmount};
use fil_actor_interface::multisig;
use fvm_ipld_blockstore::Blockstore;
use num::Zero;
use num_bigint::BigInt;

macro_rules! for_each_method {
($callback:ident) => {
Expand All @@ -24,7 +24,7 @@ impl RpcMethod<3> for MsigGetVested {
const PERMISSION: Permission = Permission::Read;

type Params = (Address, ApiTipsetKey, ApiTipsetKey);
type Ok = TokenAmount;
type Ok = BigInt;

async fn handle(
ctx: Ctx<impl Blockstore + Send + Sync + 'static>,
Expand All @@ -41,7 +41,7 @@ impl RpcMethod<3> for MsigGetVested {
None,
));
} else if start_ts.epoch() == end_ts.epoch() {
return Ok(TokenAmount::zero());
return Ok(BigInt::from(0));
}

let msig_actor = ctx
Expand All @@ -51,6 +51,6 @@ impl RpcMethod<3> for MsigGetVested {

let start_lb: TokenAmount = ms.locked_balance(start_ts.epoch())?.into();
let end_lb: TokenAmount = ms.locked_balance(end_ts.epoch())?.into();
Ok(start_lb - &end_lb)
Ok(start_lb.atto() - end_lb.atto())
}
}
2 changes: 1 addition & 1 deletion src/tool/subcommands/api_cmd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -710,8 +710,8 @@ fn state_tests_with_tipset<DB: Blockstore>(
))?),
RpcTest::identity(MsigGetVested::request((
Address::new_id(18101), // msig address id
tipset.key().into(),
tipset.parents().into(),
tipset.key().into(),
))?),
RpcTest::identity(StateGetBeaconEntry::request((tipset.epoch(),))?),
// Not easily verifiable by using addresses extracted from blocks as most of those yield `null`
Expand Down

0 comments on commit 489ae50

Please sign in to comment.