11// Copyright 2019-2022 ChainSafe Systems
22// SPDX-License-Identifier: Apache-2.0, MIT
33
4- use fvm_ipld_blockstore:: Blockstore ;
54use fvm_ipld_encoding:: RawBytes ;
65use fvm_shared:: address:: { Address , Protocol } ;
76use fvm_shared:: crypto:: signature:: SignatureType :: { Secp256k1 , BLS } ;
@@ -42,11 +41,7 @@ pub struct Actor;
4241
4342impl Actor {
4443 /// Constructor for Account actor
45- pub fn constructor < BS , RT > ( rt : & mut RT , address : Address ) -> Result < ( ) , ActorError >
46- where
47- BS : Blockstore ,
48- RT : Runtime < BS > ,
49- {
44+ pub fn constructor ( rt : & mut impl Runtime , address : Address ) -> Result < ( ) , ActorError > {
5045 rt. validate_immediate_caller_is ( std:: iter:: once ( & SYSTEM_ACTOR_ADDR ) ) ?;
5146 match address. protocol ( ) {
5247 Protocol :: Secp256k1 | Protocol :: BLS => { }
@@ -60,11 +55,7 @@ impl Actor {
6055 }
6156
6257 /// Fetches the pubkey-type address from this actor.
63- pub fn pubkey_address < BS , RT > ( rt : & mut RT ) -> Result < Address , ActorError >
64- where
65- BS : Blockstore ,
66- RT : Runtime < BS > ,
67- {
58+ pub fn pubkey_address ( rt : & mut impl Runtime ) -> Result < Address , ActorError > {
6859 rt. validate_immediate_caller_accept_any ( ) ?;
6960 let st: State = rt. state ( ) ?;
7061 Ok ( st. address )
@@ -73,14 +64,10 @@ impl Actor {
7364 /// Authenticates whether the provided signature is valid for the provided message.
7465 /// Should be called with the raw bytes of a signature, NOT a serialized Signature object that includes a SignatureType.
7566 /// Errors with USR_ILLEGAL_ARGUMENT if the authentication is invalid.
76- pub fn authenticate_message < BS , RT > (
77- rt : & mut RT ,
67+ pub fn authenticate_message (
68+ rt : & mut impl Runtime ,
7869 params : AuthenticateMessageParams ,
79- ) -> Result < ( ) , ActorError >
80- where
81- BS : Blockstore ,
82- RT : Runtime < BS > ,
83- {
70+ ) -> Result < ( ) , ActorError > {
8471 rt. validate_immediate_caller_accept_any ( ) ?;
8572 let st: State = rt. state ( ) ?;
8673 let address = st. address ;
@@ -104,28 +91,23 @@ impl Actor {
10491 }
10592
10693 // Always succeeds, accepting any transfers.
107- pub fn universal_receiver_hook < BS , RT > (
108- rt : & mut RT ,
94+ pub fn universal_receiver_hook (
95+ rt : & mut impl Runtime ,
10996 _params : & RawBytes ,
110- ) -> Result < ( ) , ActorError >
111- where
112- BS : Blockstore ,
113- RT : Runtime < BS > ,
114- {
97+ ) -> Result < ( ) , ActorError > {
11598 rt. validate_immediate_caller_accept_any ( ) ?;
11699 Ok ( ( ) )
117100 }
118101}
119102
120103impl ActorCode for Actor {
121- fn invoke_method < BS , RT > (
104+ fn invoke_method < RT > (
122105 rt : & mut RT ,
123106 method : MethodNum ,
124107 params : & RawBytes ,
125108 ) -> Result < RawBytes , ActorError >
126109 where
127- BS : Blockstore ,
128- RT : Runtime < BS > ,
110+ RT : Runtime ,
129111 {
130112 match FromPrimitive :: from_u64 ( method) {
131113 Some ( Method :: Constructor ) => {
0 commit comments