File tree Expand file tree Collapse file tree 5 files changed +30
-2
lines changed
Expand file tree Collapse file tree 5 files changed +30
-2
lines changed Original file line number Diff line number Diff line change @@ -281,6 +281,7 @@ pub mod pallet {
281281
282282 impl < T : Config > Pallet < T > {
283283 /// Get the account ID of the pallet
284+ /// Translates to gJpDhAL2bdaamftxXHXTbNxL6EZcXrgSmeLJzn2ficD3n4oWV
284285 pub fn pallet_account_id ( ) -> T :: AccountId {
285286 T :: PalletId :: get ( ) . into_account_truncating ( )
286287 }
Original file line number Diff line number Diff line change @@ -111,7 +111,7 @@ impl pallet_assets::Config for Test {
111111}
112112
113113parameter_types ! {
114- pub const WrapperPalletId : PalletId = PalletId ( * b"pwrapper " ) ;
114+ pub const WrapperPalletId : PalletId = PalletId ( * b"p/wrpper " ) ;
115115 pub const LocalTracAssetId : AssetId = 1 ;
116116 pub const ForeignTracAssetId : AssetId = 2 ;
117117}
Original file line number Diff line number Diff line change 1414use super :: * ;
1515use crate :: mock:: * ;
1616use frame_support:: { assert_noop, assert_ok} ;
17+ use sp_core:: crypto:: Ss58Codec ;
1718
1819#[ test]
1920fn trac_wrap_works ( ) {
@@ -302,7 +303,7 @@ fn cross_user_wrap_operations_work() {
302303fn pallet_account_id_helper_is_correct ( ) {
303304 new_test_ext ( ) . execute_with ( || {
304305 let pallet_account = Wrapper :: pallet_account_id ( ) ;
305- assert_eq ! ( pallet_account, 7021806093762588525 ) ;
306+ assert_eq ! ( pallet_account, 8248113402453716845 ) ;
306307 } ) ;
307308}
308309
Original file line number Diff line number Diff line change 11#![ cfg( test) ]
22
33mod assets;
4+ mod wrapper;
45
56use neuroweb_runtime:: { Runtime , System } ;
67use sp_runtime:: BuildStorage ;
Original file line number Diff line number Diff line change 1+ #![ cfg( test) ]
2+
3+ use super :: new_test_ext;
4+ use neuroweb_runtime:: { AccountId , TracWrapperPalletId , Wrapper } ;
5+ use sp_core:: crypto:: { Ss58AddressFormat , Ss58Codec } ;
6+ use sp_runtime:: traits:: AccountIdConversion ;
7+
8+ #[ test]
9+ fn wrapper_pallet_account ( ) {
10+ new_test_ext ( ) . execute_with ( || {
11+ let wrapper_pallet_account_raw: AccountId = Wrapper :: pallet_account_id ( ) ;
12+ let wrapper_pallet_account_formatted =
13+ wrapper_pallet_account_raw. to_ss58check_with_version ( Ss58AddressFormat :: custom ( 101 ) ) ;
14+
15+ assert_eq ! (
16+ wrapper_pallet_account_raw,
17+ TracWrapperPalletId :: get( ) . into_account_truncating( )
18+ ) ;
19+
20+ assert_eq ! (
21+ wrapper_pallet_account_formatted,
22+ "gJpDhAL2bdaamftxXHXTbNxL6EZcXrgSmeLJzn2ficD3n4oWV"
23+ ) ;
24+ } ) ;
25+ }
You can’t perform that action at this time.
0 commit comments