[#137] pool: simplify session creation

Signed-off-by: Denis Kirillov <denis@nspcc.ru>
This commit is contained in:
Denis Kirillov 2022-04-05 12:15:13 +03:00 committed by Alex Vanin
parent df0573d521
commit e50e6d2828
4 changed files with 20 additions and 31 deletions

View file

@ -28,8 +28,6 @@ type ResSessionCreate struct {
id []byte
sessionKey []byte
exp uint64
}
func (x *ResSessionCreate) setID(id []byte) {
@ -52,15 +50,6 @@ func (x ResSessionCreate) PublicKey() []byte {
return x.sessionKey
}
func (x *ResSessionCreate) setExp(exp uint64) {
x.exp = exp
}
// Expiration returns epoch number of the token expiration.
func (x ResSessionCreate) Expiration() uint64 {
return x.exp
}
// SessionCreate opens a session with the node server on the remote endpoint.
// The session lifetime coincides with the server lifetime. Results can be written
// to session token which can be later attached to the requests.
@ -115,7 +104,6 @@ func (c *Client) SessionCreate(ctx context.Context, prm PrmSessionCreate) (*ResS
res.setID(body.GetID())
res.setSessionKey(body.GetSessionKey())
res.setExp(reqBody.GetExpiration())
}
// process call