mirror of
https://git.ghostchain.io/proxmio/ghost-node.git
synced 2025-12-27 19:29:56 +00:00
no need for finality delay to be an Option<u64>
Signed-off-by: Uncle Stretch <uncle.stretch@ghostchain.io>
This commit is contained in:
@@ -11,7 +11,7 @@ fn prepare_network_data() -> (u32, NetworkData) {
|
||||
(1u32, NetworkData {
|
||||
chain_name: "Ethereum".into(),
|
||||
default_endpoint: "https:://some-endpoint.my-server.com/v1/my-super-secret-key".into(),
|
||||
finality_delay: Some(69),
|
||||
finality_delay: 69,
|
||||
block_distance: 69,
|
||||
network_type: NetworkType::Evm,
|
||||
gatekeeper: b"0x1234567891234567891234567891234567891234".to_vec(),
|
||||
@@ -119,7 +119,7 @@ fn could_update_network_endpoint_from_authority_account() {
|
||||
fn could_update_network_finality_delay_from_authority_account() {
|
||||
ExtBuilder::build()
|
||||
.execute_with(|| {
|
||||
let new_finality_delay = Some(1337);
|
||||
let new_finality_delay = 1337;
|
||||
let (chain_id, network) = prepare_network_data();
|
||||
register_and_check_network(chain_id, network.clone());
|
||||
assert_ok!(GhostNetworks::update_network_finality_delay(
|
||||
@@ -311,18 +311,19 @@ fn could_not_update_network_finality_delay_from_random_account() {
|
||||
ExtBuilder::build()
|
||||
.execute_with(|| {
|
||||
let (chain_id, network) = prepare_network_data();
|
||||
let finality_delay = 1337;
|
||||
register_and_check_network(chain_id, network.clone());
|
||||
assert_err!(GhostNetworks::update_network_finality_delay(
|
||||
RuntimeOrigin::signed(RegistererAccount::get()),
|
||||
chain_id, Some(1337)),
|
||||
chain_id, finality_delay),
|
||||
DispatchError::BadOrigin);
|
||||
assert_err!(GhostNetworks::update_network_finality_delay(
|
||||
RuntimeOrigin::signed(RemoverAccount::get()),
|
||||
chain_id, Some(1337)),
|
||||
chain_id, finality_delay),
|
||||
DispatchError::BadOrigin);
|
||||
assert_err!(GhostNetworks::update_network_finality_delay(
|
||||
RuntimeOrigin::signed(RandomAccount::get()),
|
||||
chain_id, Some(1337)),
|
||||
chain_id, finality_delay),
|
||||
DispatchError::BadOrigin);
|
||||
assert_eq!(Networks::<Test>::get(chain_id), Some(network));
|
||||
});
|
||||
@@ -497,7 +498,7 @@ fn could_not_update_finality_delay_for_non_existent_network() {
|
||||
assert_eq!(Networks::<Test>::get(chain_id), None);
|
||||
assert_err!(GhostNetworks::update_network_finality_delay(
|
||||
RuntimeOrigin::signed(UpdaterAccount::get()),
|
||||
chain_id, Some(1337)),
|
||||
chain_id, 1337),
|
||||
crate::Error::<Test>::NetworkDoesNotExist);
|
||||
assert_eq!(Networks::<Test>::get(chain_id), None);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user