Skip to content

Commit 39bc008

Browse files
committed
Rename PrecompileExt::address_ss58 to PrecompileExt::account_id
1 parent b71d657 commit 39bc008

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

precompiles/src/balance_transfer.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,6 @@ where
5555
value: amount_sub.unique_saturated_into(),
5656
};
5757

58-
handle.try_dispatch_runtime_call::<R, _>(call, RawOrigin::Signed(Self::address_ss58()))
58+
handle.try_dispatch_runtime_call::<R, _>(call, RawOrigin::Signed(Self::account_id()))
5959
}
6060
}

precompiles/src/extensions.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ pub(crate) trait PrecompileExt<AccountId: From<[u8; 32]>> {
114114

115115
// ss58 public key i.e., the contract sends funds it received to the destination address from
116116
// the method parameter.
117-
fn address_ss58() -> AccountId {
117+
fn account_id() -> AccountId {
118118
let hash = H160::from_low_u64_be(Self::INDEX);
119119
let address_bytes: [u8; 20] = hash.into();
120120

@@ -140,7 +140,7 @@ mod test {
140140
#[test]
141141
fn ss58_address_from_index_works() {
142142
assert_eq!(
143-
TestPrecompile::address_ss58(),
143+
TestPrecompile::account_id(),
144144
AccountId32::from([
145145
0x3a, 0x86, 0x18, 0xfb, 0xbb, 0x1b, 0xbc, 0x47, 0x86, 0x64, 0xff, 0x53, 0x46, 0x18,
146146
0x0c, 0x35, 0xd0, 0x9f, 0xac, 0x26, 0xf2, 0x02, 0x70, 0x85, 0xb3, 0x1c, 0x56, 0xc1,

precompiles/src/staking.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -374,8 +374,7 @@ where
374374
);
375375

376376
// Execute the transfer
377-
let transfer_result =
378-
transfer_call.dispatch(RawOrigin::Signed(Self::address_ss58()).into());
377+
let transfer_result = transfer_call.dispatch(RawOrigin::Signed(Self::account_id()).into());
379378

380379
if let Err(dispatch_error) = transfer_result {
381380
log::error!(

0 commit comments

Comments
 (0)