forked from ChainSafe/gossamer
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(rpc/subscription): subscribe runtime version notify when version …
…changes (ChainSafe#1686) * add code for runtime version changed fix * fix return type * update mock in Makefile * fix core_api mock * implement notifications for runtime updates * lint * implement unregister runtime version listener * make mocks and lint * refactor runtime subscription name, change error handeling * remove unneeded select case * lint, refactor GetID to GetChannelID * lint * add sync.WaitGroup to notify Runtime Updated * add test for Register UnRegister Runtime Update Channel * add check for id * add register panic test * add test to produce panic * generate id as uuid, add locks, delete from map * update runtime updated channel ids to use uint32 * change logging to debug * remove comment * move uuid into check loop * update runtime test * add test for notify runtime updated * update runtime tests * move runtime notify from coreAPI to blockStateAPI * fix mocks for tests * refactor state_test * add tests * lint * remove commented code, fix var assignment * fix merge conflict * add check if channel is ok * update unit test * send notification as go routine Co-authored-by: Eclésio Júnior <eclesiomelo.1@gmail.com>
- Loading branch information
1 parent
0932ee8
commit 9a76d39
Showing
15 changed files
with
513 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
// Copyright 2019 ChainSafe Systems (ON) Corp. | ||
// This file is part of gossamer. | ||
// | ||
// The gossamer library is free software: you can redistribute it and/or modify | ||
// it under the terms of the GNU Lesser General Public License as published by | ||
// the Free Software Foundation, either version 3 of the License, or | ||
// (at your option) any later version. | ||
// | ||
// The gossamer library is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
// GNU Lesser General Public License for more details. | ||
// | ||
// You should have received a copy of the GNU Lesser General Public License | ||
// along with the gossamer library. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
package modules | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/stretchr/testify/require" | ||
) | ||
|
||
func TestNewMockStorageAPI(t *testing.T) { | ||
m := NewMockStorageAPI() | ||
require.NotNil(t, m) | ||
} | ||
|
||
func TestNewMockBlockAPI(t *testing.T) { | ||
m := NewMockBlockAPI() | ||
require.NotNil(t, m) | ||
} | ||
|
||
func TestNewMockCoreAPI(t *testing.T) { | ||
m := NewMockCoreAPI() | ||
require.NotNil(t, m) | ||
} | ||
|
||
func TestNewMockVersion(t *testing.T) { | ||
m := NewMockVersion() | ||
require.NotNil(t, m) | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.