Skip to content

#83 refactored transaction.proto adding noderegistration to transaction body #25

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

Merged
merged 1 commit into from
Jul 22, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 58 additions & 0 deletions documentation.swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -763,6 +763,61 @@
}
}
},
"modelNodeRegistrationTransactionBody": {
"type": "object",
"properties": {
"AccountAddress": {
"type": "string"
},
"AccountType": {
"type": "integer",
"format": "int64"
},
"LockedBalance": {
"type": "string",
"format": "int64"
},
"NodeAddress": {
"type": "string"
},
"NodePublicKey": {
"type": "string",
"format": "byte"
},
"Poown": {
"$ref": "#/definitions/modelProofOfOwnership"
},
"RegistrationHeight": {
"type": "string",
"format": "int64"
}
}
},
"modelProofOfOwnership": {
"type": "object",
"title": "TODO: shall we move this to a different file?",
"properties": {
"AccountAddress": {
"type": "string"
},
"AccountType": {
"type": "integer",
"format": "int64"
},
"blockHash": {
"type": "string",
"format": "byte"
},
"blockHeight": {
"type": "integer",
"format": "int64"
},
"signature": {
"type": "string",
"format": "byte"
}
}
},
"modelSendMoneyTransactionBody": {
"type": "object",
"properties": {
Expand Down Expand Up @@ -837,6 +892,9 @@
"emptyTransactionBody": {
"$ref": "#/definitions/modelEmptyTransactionBody"
},
"nodeRegistrationTransactionBody": {
"$ref": "#/definitions/modelNodeRegistrationTransactionBody"
},
"sendMoneyTransactionBody": {
"$ref": "#/definitions/modelSendMoneyTransactionBody"
}
Expand Down
19 changes: 0 additions & 19 deletions model/nodeRegistration.proto
Original file line number Diff line number Diff line change
Expand Up @@ -16,25 +16,6 @@ message NodeRegistration {
uint32 Height = 8;
}

message NodeRegistrationTransactionBody {
bytes NodePublicKey = 1;
uint32 AccountType = 2;
string AccountAddress = 3;
int64 RegistrationHeight = 4;
string NodeAddress = 5;
int64 LockedBalance = 6;
ProofOfOwnership Poown = 7;
}

//TODO: shall we move this to a different file?
message ProofOfOwnership {
uint32 AccountType = 1;
string AccountAddress = 2;
bytes blockHash = 3;
uint32 blockHeight = 4;
bytes signature = 5;
}

// GetNodeRegisterRequest create request to get a list node
message GetNodeRegistrationsRequest {
bytes NodePublicKey = 1;
Expand Down
22 changes: 21 additions & 1 deletion model/transaction.proto
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,9 @@ message Transaction {
oneof TransactionBody {
EmptyTransactionBody emptyTransactionBody = 15;
SendMoneyTransactionBody sendMoneyTransactionBody = 16;
NodeRegistrationTransactionBody nodeRegistrationTransactionBody = 17;
}
bytes Signature = 17;
bytes Signature = 18;
}

message EmptyTransactionBody {}
Expand All @@ -34,6 +35,25 @@ message SendMoneyTransactionBody {
int64 Amount = 1;
}

message NodeRegistrationTransactionBody {
bytes NodePublicKey = 1;
uint32 AccountType = 2;
string AccountAddress = 3;
int64 RegistrationHeight = 4;
string NodeAddress = 5;
int64 LockedBalance = 6;
ProofOfOwnership Poown = 7;
}

//TODO: shall we move this to a different file?
message ProofOfOwnership {
uint32 AccountType = 1;
string AccountAddress = 2;
bytes blockHash = 3;
uint32 blockHeight = 4;
bytes signature = 5;
}

message GetTransactionRequest {
// Fetch Transaction by its ID
int64 ID = 1;
Expand Down