Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test in tests/tendermint/main.go fails #2

Closed
davehaughton1 opened this issue Jul 11, 2016 · 4 comments
Closed

test in tests/tendermint/main.go fails #2

davehaughton1 opened this issue Jul 11, 2016 · 4 comments

Comments

@davehaughton1
Copy link

Hi, running tests/tendermint/main.go does not work correctly.

On line 116 in github.com/tendermint/basecoin/app/app.go you have:
res = sm.ExecTx(app.cacheState, app.plugins, tx, true, nil)

The function is given the argument app.cacheState, but I dont think that cacheState is ever initialized.
Perhaps it should just be app.state?

@ethanfrey
Copy link
Contributor

ethanfrey commented Jan 6, 2017

Hmmm.... just checked this on the master/develop branch, running make test

  1. go test github.com/tendermint/basecoin/... passes with no problems

  2. go run tests/tmsp/*.go failes even after make update_deps...

testGov:

Basecoin v0.1
SET 676F762F652FDD8C9EFA93F268CEB8D8336F9B05C4074C9F6D71 0114DD8C9EFA93F268CEB8D8336F9B05C4074C9F6D7101DE7F5EC1C84E76A930B476DF44F310C585274A17AF4371A23FC9CF3CE9B618F7
SET 676F762F672F61646D696E 010561646D696E000001010114DD8C9EFA93F268CEB8D8336F9B05C4074C9F6D710000000000000001
SET 626173652F612FDD8C9EFA93F268CEB8D8336F9B05C4074C9F6D71 0101DE7F5EC1C84E76A930B476DF44F310C585274A17AF4371A23FC9CF3CE9B618F7000101000020000000000000
>> B
SET 676F762F652F4D9E98B6D5853BFE840403BC4BD4C8733A14F364 01144D9E98B6D5853BFE840403BC4BD4C8733A14F36401293795AE33FB34922E7EF80C26C411C598DF1720FE13175AE8EEF1FA8C48BE60
SET 676F762F652F5245D647B58C5BB4829DBBF402F275FCF15C5EB9 01145245D647B58C5BB4829DBBF402F275FCF15C5EB901A9029ED540E459A0E71C43141225302A58EFD26C404D1805C72B62044AE79662
SET 676F762F652F4F62971EBD50F60CB2585294E75F9A620534D7AB 01144F62971EBD50F60CB2585294E75F9A620534D7AB01CDFD20FF8A82C2603A0C3358A78A6F8573D4606F2A4F0BC051953B0E67F438CA
>> &{validators  0 [{[77 158 152 182 213 133 59 254 132 4 3 188 75 212 200 115 58 20 243 100] 1} {[82 69 214 71 181 140 91 180 130 157 187 244 2 242 117 252 241 92 94 185] 1} {[79 98 151 30 189 80 246 12 178 88 82 148 231 95 154 98 5 52 215 171] 1}]}
SET 676F762F672F76616C696461746F7273 010A76616C696461746F72730000010301144D9E98B6D5853BFE840403BC4BD4C8733A14F364000000000000000101145245D647B58C5BB4829DBBF402F275FCF15C5EB9000000000000000101144F62971EBD50F60CB2585294E75F9A620534D7AB0000000000000001
Failed to query validators: TMSP code:BaseUnknownPlugin, data:, log:Unknown plugin with type byte 58
exit status 1

and testSequence:

Basecoin v0.1
SET 626173652F612F12BB36B57DA6E4EC8229F4D99E14567F1E528B0F 0101F33235D17F08FE3301747E873D83CDF37C317CB448E4B65D3FDD00C08D57A24E000101000020000000000000
Success
SET 626173652F612F12BB36B57DA6E4EC8229F4D99E14567F1E528B0F 0101F33235D17F08FE3301747E873D83CDF37C317CB448E4B65D3FDD00C08D57A24E0101010100001FFFFFFFF0BDBE
SET 626173652F612F8CCEA7851B70AD986CACC47271C76A8A743B2D4D 01000001010000000000000F4240
AppendTx error: TMSP code:BaseInvalidInput, data:, log:Error in AppendTx;in validateInputsBasic();Error (base) invalid input;PubKey must be nil when Sequence > 1
exit status 1

I have the current master branch checked out for governmint.

@ethanfrey
Copy link
Contributor

This code in the test seems to be invalid:

	// Query for validator set
	res := bcApp.Query([]byte("XXX"))
	if res.IsErr() {
		Exit(Fmt("Failed to query validators: %v", res.Error()))
	}

It is handled here (in basecoin/app/app.go):

// TMSP::Query
func (app *Basecoin) Query(query []byte) (res tmsp.Result) {
	if len(query) == 0 {
		return tmsp.ErrEncodingError.SetLog("Query cannot be zero length")
	}
	typeByte := query[0]
	query = query[1:]
	switch typeByte {
	case PluginTypeByteBase:
		return tmsp.OK.SetLog("This type of query not yet supported")
	case PluginTypeByteEyes:
		return app.eyesCli.QuerySync(query)
	}
	return tmsp.ErrBaseUnknownPlugin.SetLog(
		Fmt("Unknown plugin with type byte %X", typeByte))
}

It seems like this could never pass, as the type byte must be 0x01 or 0x02... not X.

Not sure if this code even matters to be fixed, or just removed?

@rigelrozanski
Copy link
Contributor

@ethanfrey go run tests/tmsp/*.go have been fixed in latest commits. Code should be modified to utilize the go testing toolkit, but works as a part of the current make test command

@ethanfrey
Copy link
Contributor

Alright, then this issue is closed. Thanks rigel!

ethanfrey added a commit that referenced this issue Oct 25, 2017
Refactor out BaseApp, StoreApp (per spec #1 and #2)
adrianbrink pushed a commit that referenced this issue Jun 29, 2018
@cwgoes cwgoes mentioned this issue Oct 5, 2018
5 tasks
tac0turtle added a commit that referenced this issue Sep 20, 2019
tac0turtle added a commit that referenced this issue Sep 20, 2019
dogemos referenced this issue in dogemos/cosmos-sdk Apr 9, 2020
mergify bot pushed a commit that referenced this issue Oct 6, 2020
* enforce client-chosen parameters are persisted across upgrades in tendermint clients

* Update x/ibc/light-clients/07-tendermint/types/upgrade.go

Co-authored-by: colin axnér <25233464+colin-axner@users.noreply.github.com>
@cyberbono3 cyberbono3 mentioned this issue Mar 18, 2021
9 tasks
Raumo0 pushed a commit to mapofzones/cosmos-sdk that referenced this issue Jun 20, 2021
* add governance hooks

* Update x/gov/types/hooks.go

* fixed

* Update x/gov/keeper/keeper.go

* remove VoteOption from hooks

* fix lint

* remove depositAmount and add depositorAddr

* fix lint

* fix cosmosvisor?

* sh -> gh

* Apply suggestions from code review

Co-authored-by: Dev Ojha <ValarDragon@users.noreply.github.com>

Co-authored-by: ahmedaly113 <ahmedaly113@outlook.com>
Co-authored-by: Dev Ojha <ValarDragon@users.noreply.github.com>
Raumo0 pushed a commit to mapofzones/cosmos-sdk that referenced this issue Sep 14, 2021
* add governance hooks

* Update x/gov/types/hooks.go

* fixed

* Update x/gov/keeper/keeper.go

* remove VoteOption from hooks

* fix lint

* remove depositAmount and add depositorAddr

* fix lint

* fix cosmosvisor?

* sh -> gh

* Apply suggestions from code review

Co-authored-by: Dev Ojha <ValarDragon@users.noreply.github.com>

Co-authored-by: ahmedaly113 <ahmedaly113@outlook.com>
Co-authored-by: Dev Ojha <ValarDragon@users.noreply.github.com>
jtremback added a commit that referenced this issue Nov 12, 2021
Staking integration for interchain security
Vvaradinov added a commit to Vvaradinov/cosmos-sdk that referenced this issue Dec 14, 2022
chillyvee pushed a commit to chillyvee/cosmos-sdk that referenced this issue Mar 1, 2024
hoanguyenkh pushed a commit to hoanguyenkh/cosmos-sdk that referenced this issue Apr 25, 2024
sainoe added a commit that referenced this issue May 24, 2024
Co-authored-by: Philip Offtermatt <p.offtermatt@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants