Reject unknown fields in TxDecoder and sign mode handlers (#6883)

* WIP on unknown field rejection in TxDecoder

* WIP on unknown field rejection in TxDecoder

* WIP

* WIP

* WIP

* WIP

* Fix bugs with RejectUnknownFields

* Fix tests

* Fix bug and update docs

* Lint

* Add tests

* Add unknown field tests

* Lint

* Address review comments
This commit is contained in:
Aaron Craelius
2020-08-03 19:47:25 +00:00
committed by GitHub
parent 57cd7d62b3
commit 6d937443b2
31 changed files with 2598 additions and 968 deletions
+1355 -105
View File
File diff suppressed because it is too large Load Diff
+26
View File
@@ -3,6 +3,7 @@ package testdata;
import "gogoproto/gogo.proto";
import "google/protobuf/any.proto";
import "cosmos/tx/tx.proto";
option go_package = "github.com/cosmos/cosmos-sdk/testutil/testdata";
@@ -341,3 +342,28 @@ message AnyWithExtra {
int64 b = 3;
int64 c = 4;
}
message TestUpdatedTxRaw {
bytes body_bytes = 1;
bytes auth_info_bytes = 2;
repeated bytes signatures = 3;
bytes new_field_5 = 5;
bytes new_field_1024 = 1024;
}
message TestUpdatedTxBody {
repeated google.protobuf.Any messages = 1;
string memo = 2;
int64 timeout_height = 3;
uint64 some_new_field = 4;
string some_new_field_non_critical_field = 1050;
repeated google.protobuf.Any extension_options = 1023;
repeated google.protobuf.Any non_critical_extension_options = 2047;
}
message TestUpdatedAuthInfo {
repeated cosmos.tx.SignerInfo signer_infos = 1;
cosmos.tx.Fee fee = 2;
bytes new_field_3 = 3;
bytes new_field_1024 = 1024;
}