File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -50,6 +50,8 @@ def from_source_account(
5050 ) -> "Identity" :
5151 if account is None :
5252 identity = Identity ()
53+ if isinstance (account , str ) and account .startswith ("S" ) and len (account ) == 56 :
54+ identity = Identity (secret_key = account )
5355 elif isinstance (account , (str , pathlib .Path )):
5456 fname = _load_configuration (account , "identity" )
5557 identity = Identity (_env_file = fname )
Original file line number Diff line number Diff line change 99class TestIdentity :
1010 def test_file (self ):
1111 alice_fname = pathlib .Path (__file__ ).parent / "alice.toml"
12- soroban .Identity (_env_file = alice_fname ). model_dump ()
12+ soroban .Identity (_env_file = alice_fname )
1313
1414 def test_from_pk (self ):
1515 keypair = Keypair .random ()
1616 soroban .Identity (secret_key = keypair .secret )
17- soroban .Identity (keypair = keypair ). model_dump ()
17+ soroban .Identity (keypair = keypair )
1818
1919 def test_from_source_account (self ):
2020 alice_fname = pathlib .Path (__file__ ).parent / "alice.toml"
@@ -23,19 +23,21 @@ def test_from_source_account(self):
2323 keypair = Keypair .random ()
2424 soroban .Identity .from_source_account (account = keypair )
2525
26+ soroban .Identity .from_source_account (account = keypair .secret )
27+
2628 def test_raises (self ):
2729 with pytest .raises (ValueError , match = "provide a secret key or a Keypair" ):
28- soroban .Identity (). model_dump ()
30+ soroban .Identity ()
2931
3032 keypair = Keypair .random ()
3133 with pytest .raises (ValueError , match = "provide a secret key or a Keypair" ):
32- soroban .Identity (public_key = keypair .public_key ). model_dump ()
34+ soroban .Identity (public_key = keypair .public_key )
3335
3436
3537class TestNetworkConfig :
3638 def test_from_network (self ):
3739 testnet = pathlib .Path (__file__ ).parent / "testnet.toml"
38- soroban .NetworkConfig .from_network (network = testnet ). model_dump ()
40+ soroban .NetworkConfig .from_network (network = testnet )
3941
4042
4143class TestParams :
You can’t perform that action at this time.
0 commit comments