You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 0dc0b4a
Browse filesBrowse the repository at this point in the historyBrowse files
First step towards superblock impl, where evm block height will be equal
to RoadIndex instead of GlobalBlockNumber.
We start with setting first both RoadIndex and GlobalBlockNumber to
initialHeight, so that indexing switch becomes implementation detail.
Copy file name to clipboardExpand all lines: sei-tendermint/AGENTS.md
+7-3Lines changed: 7 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,12 +1,16 @@
1
1
Within sei-tendermint subdirectory
2
2
* sei-tendermint is a root of the go module, but it is not the root of the repo. When refactoring check references across of the whole repo.
3
3
Comply with repo's root AGENTS.md, except where they conflict with the rules below.
4
+
* ensure type safety wherever possible, in particular
5
+
* use strong types rather than underlying primitives (urls should use URL type instead of string, time duration should use time.Duration instead of int, etc.)
6
+
* avoid dynamic casts - type information should be passed along the callstack, not rediscovered at the bottom
7
+
* use strongly typed utils/require asserts instead of testify/require
4
8
* use sei-tendermint/libs/utils.Option for optional values, passing nil as function value is not allowed,
5
9
unless explicitly documented (except for maps and slices, for which nil is a valid empty value).
6
-
* struct fields are assumed to be non-nil by default. Do not add defensive nil-checks in internal logic.
10
+
* struct fields are assumed to be non-nil by default. Storing nil as field value is not allowed (except for slices and constant maps).
11
+
Do not add defensive nil-checks in internal logic.
7
12
External data, like proto generated code for example, might require nil checks.
8
13
* use utils.Recv/utils.Send instead of select { case <-ctx.Done(); ... }
9
-
* use strongly typed utils/require asserts instead of testify/require
10
14
* use sei-tendermint/libs/utils/scope.Run for structured concurrency (instead of waitgroup).
11
15
* Don't spawn goroutines with plain "go func(){...}"
12
16
* using testing.T assertions (inclusing those from "require" library) is not allowed from non-main test goroutine.
@@ -22,7 +26,7 @@ Within sei-tendermint subdirectory
22
26
of sync.Mutex.
23
27
* use public api of types in tests, never malform internal state of types. For read-only access,
24
28
you can use private fields directly in case it is not accessible via public api.
25
-
* when writing tests, focus on asserting the publically visible properties, especially the API contract. Avoid asserting implementation details.
29
+
* when writing tests, focus on asserting the publicly visible properties, especially the API contract. Avoid asserting implementation details.
26
30
* Avoid sleeping and active polling in tests. Prefer waiting for updates (for example by using sei-tendermint/libs/utils.Watch or AtomicWatch).
27
31
* Do not introduce artificial timeouts in tests because they are a source of flakiness. Let the test hang and make the user run go tests with explicit
0 commit comments