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

Add application version compatibility check. #5253

Closed

Conversation

Projects
None yet
2 participants
@cslashm
Copy link
Contributor

commented Mar 7, 2019

No description provided.

if (minor < MINIMAL_MINOR_APP_VERSION) {
ASSERT_X(false, MINIMAL_VERSION_ERROR_MESSAGE);
}
#undef MINIMAL_VERSION

This comment has been minimized.

Copy link
@moneromooo-monero

moneromooo-monero Mar 7, 2019

Contributor

You probably want MINIMAL_VERSION_ERROR_MESSAGE here

}

#define MINIMAL_VERSION_ERROR_MESSAGE \
"Unsuppotred device application version: "<<major<<"."<<minor<<"."<<micro<<"."\

This comment has been minimized.

Copy link
@moneromooo-monero

moneromooo-monero Mar 7, 2019

Contributor

Unsupported


#define MINIMAL_VERSION_ERROR_MESSAGE \
"Unsuppotred device application version: "<<major<<"."<<minor<<"."<<micro<<"."\
" At least " << MINIMAL_MAJOR_APP_VERSION<<"."<<MINIMAL_MINOR_APP_VERSION<<"."<<MINIMAL_MICRO_APP_VERSION << " is requiered."

This comment has been minimized.

Copy link
@moneromooo-monero

moneromooo-monero Mar 7, 2019

Contributor

required

}
if (minor < MINIMAL_MINOR_APP_VERSION) {
ASSERT_X(false, MINIMAL_VERSION_ERROR_MESSAGE);
}

This comment has been minimized.

Copy link
@moneromooo-monero

moneromooo-monero Mar 7, 2019

Contributor

That seems wrong. It will fail once you get to 2.0.0.
Maybe, eg:

 ASSERT_X(major*65536+minor*256+micro >= 0x010200, MINIMAL_VERSION_ERROR_MESSAGE);

(untested)
And you also get only one line with it :)

This comment has been minimized.

Copy link
@cslashm

cslashm Mar 8, 2019

Author Contributor

you are right!.
I will take your approach with shift: (major<<24) | (minor<<16) | micro

this->exchange();
this->exchange();

ASSERT_X(this->length_recv>=3, "Communication error, less than tow three bytes received. Check your application version.");

This comment has been minimized.

Copy link
@moneromooo-monero

This comment has been minimized.

Copy link
@cslashm

cslashm Mar 8, 2019

Author Contributor

major, minor, micro : three

This comment has been minimized.

Copy link
@moneromooo-monero

moneromooo-monero Mar 8, 2019

Contributor

Yes, I mean the "tow" seems like it's extra unneeded word here.

This comment has been minimized.

Copy link
@cslashm

cslashm Mar 8, 2019

Author Contributor

OMG yes. It seems I'am a bit tired 😪

@cslashm cslashm force-pushed the cslashm:AddVersionCheck branch from 59109cf to 430ff45 Mar 11, 2019

@cslashm cslashm closed this Mar 13, 2019

@cslashm cslashm deleted the cslashm:AddVersionCheck branch Mar 21, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.