From 91250e1ec6c224e9150f659fcef1c0476ee9d2c7 Mon Sep 17 00:00:00 2001 From: Leo Chen Date: Wed, 25 Nov 2020 09:13:07 +0000 Subject: [PATCH] [rosetta] use shard config instead of default config Signed-off-by: Leo Chen --- rosetta/rosetta.go | 2 +- rosetta/services/network.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/rosetta/rosetta.go b/rosetta/rosetta.go index 6ee571222..db830fe5f 100644 --- a/rosetta/rosetta.go +++ b/rosetta/rosetta.go @@ -36,7 +36,7 @@ func StartServers(hmy *hmy.Harmony, config nodeconfig.RosettaServerConfig) error } serverAsserter, err := asserter.NewServer( append(common.PlainOperationTypes, common.StakingOperationTypes...), - nodeconfig.GetDefaultConfig().Role() == nodeconfig.ExplorerNode, + nodeconfig.GetShardConfig(hmy.ShardID).Role() == nodeconfig.ExplorerNode, []*types.NetworkIdentifier{network}, ) if err != nil { diff --git a/rosetta/services/network.go b/rosetta/services/network.go index 98d52832f..707feb24a 100644 --- a/rosetta/services/network.go +++ b/rosetta/services/network.go @@ -98,7 +98,7 @@ func (s *NetworkAPI) NetworkStatus( // Only applicable to non-archival nodes var oldestBlockIdentifier *types.BlockIdentifier - if !nodeconfig.GetDefaultConfig().GetArchival() { + if !nodeconfig.GetShardConfig(s.hmy.ShardID).GetArchival() { maxGarbCollectedBlockNum := s.hmy.BlockChain.GetMaxGarbageCollectedBlockNumber() if maxGarbCollectedBlockNum == -1 || maxGarbCollectedBlockNum >= currentHeader.Number().Int64() { oldestBlockIdentifier = currentBlockIdentifier @@ -143,7 +143,7 @@ func (s *NetworkAPI) NetworkOptions( // Fetch allows based on current network option var allow *types.Allow - isArchival := nodeconfig.GetDefaultConfig().GetArchival() + isArchival := nodeconfig.GetShardConfig(s.hmy.ShardID).GetArchival() if s.hmy.ShardID == shard.BeaconChainShardID { allow = getBeaconAllow(isArchival) } else {