Skip to content
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 }}
Uh oh!
There was an error while loading.
Please reload this page
.
PostState
/
proto-code
Public
Notifications
You must be signed in to change notification settings
Fork
0
Star
1
Code
Issues
0
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Files
Expand file tree
main
Breadcrumbs
proto-code
/
Educational_Functionality
Copy path
Blame
More file actions
Blame
More file actions
Latest commit
History
History
History
45 lines (37 loc) · 1.37 KB
main
Breadcrumbs
proto-code
/
Educational_Functionality
Copy path
Top
File metadata and controls
Code
Blame
45 lines (37 loc) · 1.37 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
// app/app.go
// ...
// Транзакция для создания образовательной задачи
type CreateEducationalTaskTx struct {
Creator sdk.AccAddress
Task string
Reward sdk.Coin
}
func NewCreateEducationalTaskTx(creator sdk.AccAddress, task string, reward sdk.Coin) CreateEducationalTaskTx {
return CreateEducationalTaskTx{
Creator: creator,
Task: task,
Reward: reward,
}
}
func (tx CreateEducationalTaskTx) ValidateBasic() error {
// Валидация транзакции
// ...
}
func (tx CreateEducationalTaskTx) GetSignBytes() []byte {
// Получение байт для подписи
// ...
}
func (tx CreateEducationalTaskTx) GetSigners() []sdk.AccAddress {
return []sdk.AccAddress{tx.Creator}
}
// Обработчик транзакции для создания образовательной задачи
func handleCreateEducationalTask(ctx sdk.Context, keeper education.Keeper, tx CreateEducationalTaskTx) sdk.Result {
// Проверки и логика для обработки транзакции
// ...
// Создание образовательной задачи с помощью Keeper модуля образования
err := keeper.CreateEducationalTask(ctx, tx.Creator, tx.Task, tx.Reward)
if err != nil {
return sdk.ErrInternal("unable to create educational task").Result()
}
return sdk.Result{}
}
You can’t perform that action at this time.