@@ -50,6 +50,18 @@ class PolygonAmoyConfig:
5050 assert w3 .eth .default_account == DEFAULT_GAS_PAYER
5151 assert w3 .manager ._provider .endpoint_uri == PolygonAmoyConfig .rpc_api
5252
53+ def test_get_web3_aurora_testnet (self ):
54+ class AuroraTestnetConfig :
55+ chain_id = 1313161555
56+ rpc_api = " https://testnet.aurora.dev"
57+ private_key = DEFAULT_GAS_PAYER_PRIV
58+
59+ with patch ("src.chain.web3.Config.aurora_testnet" , AuroraTestnetConfig ):
60+ w3 = get_web3 (ChainId .AURORA_TESTNET .value )
61+ assert isinstance (w3 , Web3 )
62+ assert w3 .eth .default_account == DEFAULT_GAS_PAYER
63+ assert w3 .manager ._provider .endpoint_uri == AuroraTestnetConfig .rpc_api
64+
5365 def test_get_web3_localhost (self ):
5466 w3 = get_web3 (ChainId .LOCALHOST .value )
5567 assert isinstance (w3 , Web3 )
@@ -82,6 +94,19 @@ def test_sign_message_amoy(self):
8294 assert signature == SIGNATURE
8395 assert serialized_message == json .dumps ("message" )
8496
97+ def test_sign_message_aurora_tesnet (self ):
98+ with patch ("src.chain.web3.get_web3" ) as mock_function :
99+ with patch (
100+ "src.chain.web3.Config.aurora_testnet.private_key" ,
101+ DEFAULT_GAS_PAYER_PRIV ,
102+ ):
103+ mock_function .return_value = self .w3
104+ signature , serialized_message = sign_message (
105+ ChainId .AURORA_TESTNET .value , "message"
106+ )
107+ assert signature == SIGNATURE
108+ assert serialized_message == json .dumps ("message" )
109+
85110 def test_sign_message_invalid_chain_id (self ):
86111 with pytest .raises (ValueError , match = "1234 is not in available list of networks." ):
87112 sign_message (1234 , "message" )
0 commit comments