Skip to content

Commit

Permalink
Call exported authenticate method from PSD (#829)
Browse files Browse the repository at this point in the history
Co-authored-by: zenground0 <ZenGround0@users.noreply.github.com>
  • Loading branch information
2 people authored and arajasek committed Nov 17, 2022
1 parent 6caea40 commit d2cf652
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 8 deletions.
4 changes: 2 additions & 2 deletions actors/account/tests/account_actor_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ fn authenticate_message() {
});
assert_eq!(
RawBytes::default(),
rt.call::<AccountActor>(Method::AuthenticateMessage as MethodNum, &params).unwrap()
rt.call::<AccountActor>(Method::AuthenticateMessageExported as MethodNum, &params).unwrap()
);
rt.verify();

Expand All @@ -118,7 +118,7 @@ fn authenticate_message() {
expect_abort_contains_message(
ExitCode::USR_ILLEGAL_ARGUMENT,
"bad signature",
rt.call::<AccountActor>(Method::AuthenticateMessage as MethodNum, &params),
rt.call::<AccountActor>(Method::AuthenticateMessageExported as MethodNum, &params),
);
rt.verify();

Expand Down
3 changes: 2 additions & 1 deletion actors/market/src/ext.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ use fvm_shared::smooth::FilterEstimate;
pub mod account {
use super::*;

pub const AUTHENTICATE_MESSAGE_METHOD: u64 = 3;
pub const AUTHENTICATE_MESSAGE_METHOD: u64 =
frc42_dispatch::method_hash!("AuthenticateMessage");

#[derive(Serialize_tuple, Deserialize_tuple)]
pub struct AuthenticateMessageParams {
Expand Down
2 changes: 1 addition & 1 deletion test_vm/src/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1130,7 +1130,7 @@ pub fn market_publish_deal(
},
ExpectInvocation {
to: deal_client,
method: AccountMethod::AuthenticateMessage as u64,
method: AccountMethod::AuthenticateMessageExported as u64,
..Default::default()
},
];
Expand Down
6 changes: 3 additions & 3 deletions test_vm/tests/account_authenticate_message_test.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use fil_actor_account::types::AuthenticateMessageParams;
use fil_actor_account::Method::AuthenticateMessage;
use fil_actor_account::Method::AuthenticateMessageExported;
use fvm_ipld_blockstore::MemoryBlockstore;
use fvm_ipld_encoding::RawBytes;
use fvm_shared::bigint::Zero;
Expand Down Expand Up @@ -32,7 +32,7 @@ fn account_authenticate_message() {
addr,
addr,
TokenAmount::zero(),
AuthenticateMessage as u64,
AuthenticateMessageExported as u64,
authenticate_message_params,
);

Expand All @@ -44,7 +44,7 @@ fn account_authenticate_message() {
addr,
addr,
TokenAmount::zero(),
AuthenticateMessage as u64,
AuthenticateMessageExported as u64,
authenticate_message_params,
ExitCode::USR_ILLEGAL_ARGUMENT,
);
Expand Down
2 changes: 1 addition & 1 deletion test_vm/tests/publish_deals_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -553,7 +553,7 @@ fn psd_bad_sig() {
},
ExpectInvocation {
to: a.client1,
method: AccountMethod::AuthenticateMessage as u64,
method: AccountMethod::AuthenticateMessageExported as u64,
params: Some(
serialize(
&AuthenticateMessageParams {
Expand Down

0 comments on commit d2cf652

Please sign in to comment.