-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add mapping * rm unused mapping/*, rm interfaces * rm unused code * mv mapping -> state, rm x/ibc * rm GetIfExists * add key * rm custom encoding/decoding in enum/bool * fix lint * rm tests * add commitment * newtyped remote values * newtyped context * revert context newtype * add README, keypath * reflect downstream ics * add merkle * add test for proving * soft coded root keypath * add update * remove RootUpdate * separate keypath and keuprefix * add codec * separate root/path * add path to codec * add docs in progre * add comments * add comments * Apply suggestions from code review Co-Authored-By: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * add comments in progress * add comments * fix comment * add comments in progress * recover IntEncoding scheme for integer * add uint tests, don't use codec in custom types * finalize merge * add godoc * reformat test * rm XXX * add godoc * add query * update query.go * update query.go * add Query to boolean.go * fix key * godoc cleanup * godoc cleanup * godoc cleanup * godoc cleanup * godoc cleanup * merge from ics04 branch * merge from ics04 branch * fix lint * Apply suggestions from code review Co-Authored-By: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * applying review in progress * apply review - make querier interface * fix dependency * revise querier interface to work both on cli & store * rm commented lines * rename Path -> Prefix * Store accessor upstream changes (#5119) * Store accessor upstream changes (#5119) * add comments, reformat merkle querier * rm merkle/utils * ICS 23 upstream changes (#5120) * ICS 23 upstream changes (#5120) * update Value * remove Mapping * remove store accessors * refactor ICS23 * cleanup types * implement batch verification * gosimple suggestion * alias * add tests * ICS 24 Implementation (#5229) * add validation functions * validate path in ics-23 * address @fede comments * move errors into host package * flatten ICS23 structure * fix ApplyPrefix * complete types testing * delete empty test file * remove ibc errors from core error package * start batch-verify tests * minor changes on commitment types * use testsuite * upstream changes * context changes
- Loading branch information
1 parent
2ecbfe9
commit 220a482
Showing
11 changed files
with
719 additions
and
16 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package commitment | ||
|
||
import ( | ||
"github.com/cosmos/cosmos-sdk/codec" | ||
) | ||
|
||
// RegisterCodec registers types declared in this package | ||
func RegisterCodec(cdc *codec.Codec) { | ||
cdc.RegisterInterface((*RootI)(nil), nil) | ||
cdc.RegisterInterface((*PrefixI)(nil), nil) | ||
cdc.RegisterInterface((*PathI)(nil), nil) | ||
cdc.RegisterInterface((*ProofI)(nil), nil) | ||
|
||
cdc.RegisterConcrete(Root{}, "ibc/commitment/merkle/Root", nil) | ||
cdc.RegisterConcrete(Prefix{}, "ibc/commitment/merkle/Prefix", nil) | ||
cdc.RegisterConcrete(Path{}, "ibc/commitment/merkle/Path", nil) | ||
cdc.RegisterConcrete(Proof{}, "ibc/commitment/merkle/Proof", nil) | ||
} |
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,37 @@ | ||
package commitment_test | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/stretchr/testify/suite" | ||
|
||
"github.com/cosmos/cosmos-sdk/store/iavl" | ||
"github.com/cosmos/cosmos-sdk/store/rootmulti" | ||
storetypes "github.com/cosmos/cosmos-sdk/store/types" | ||
|
||
dbm "github.com/tendermint/tm-db" | ||
) | ||
|
||
type MerkleTestSuite struct { | ||
suite.Suite | ||
|
||
store *rootmulti.Store | ||
storeKey *storetypes.KVStoreKey | ||
iavlStore *iavl.Store | ||
} | ||
|
||
func (suite *MerkleTestSuite) SetupTest() { | ||
db := dbm.NewMemDB() | ||
suite.store = rootmulti.NewStore(db) | ||
|
||
suite.storeKey = storetypes.NewKVStoreKey("iavlStoreKey") | ||
|
||
suite.store.MountStoreWithDB(suite.storeKey, storetypes.StoreTypeIAVL, nil) | ||
suite.store.LoadVersion(0) | ||
|
||
suite.iavlStore = suite.store.GetCommitStore(suite.storeKey).(*iavl.Store) | ||
} | ||
|
||
func TestMerkleTestSuite(t *testing.T) { | ||
suite.Run(t, new(MerkleTestSuite)) | ||
} |
Oops, something went wrong.