Commit Graph

385 Commits

Author SHA1 Message Date
Ethan Frey 3e9d208300 Clean up recursive query tests 2020-07-28 10:49:14 +02:00
Ethan Frey 21dd88137a Rename type ProposalTypeStoreInstantiateContract 2020-07-27 19:38:04 +02:00
Ethan Frey 133ed4e75e Add testcase for ConvertToProposals 2020-07-27 19:36:39 +02:00
Ethan Frey 7b1a4de59d Add logic to app.go to configure enabled proposals 2020-07-27 19:20:25 +02:00
Ethan Frey e83f2de688 Cleanup from PR comments 2020-07-27 14:56:29 +02:00
Ethan Frey e088aecde1 Test external query gas limits are still enforced 2020-07-27 14:10:09 +02:00
Ethan Frey 8af0c88e34 Test gas charged properly for various recursion levels 2020-07-27 13:48:33 +02:00
Ethan Frey f74e077a27 Properly charge gas in keeper 2020-07-27 13:44:18 +02:00
Ethan Frey fa5d338509 Framework for recursive query tests 2020-07-27 13:32:07 +02:00
Ethan Frey 5224936dcd
Merge pull request #218 from CosmWasm/update-go-cosmwasm
Update go cosmwasm
2020-07-24 13:55:33 +02:00
Alex Peters ff8991e950
Adopt contract updates to TestImportContractWithCodeHistoryReset 2020-07-24 13:41:32 +02:00
Ethan Frey e43c032e66 Store Message ignores missing permission from JSON 2020-07-24 11:43:39 +02:00
Ethan Frey 4c6757fc1e Always throw OutOfGas panic when wasmer uses all gas 2020-07-24 11:31:09 +02:00
Ethan Frey 6ef26fa768 Updated all test contracts, gas costs 2020-07-24 11:05:00 +02:00
Ethan Frey fae55715e5 Update go-cosmwasm to v0.10.0-alpha2 and code compiles 2020-07-24 10:51:10 +02:00
Ethan Frey 5e6a0eb01d Handle gas meter multiplier in x/wasm not go-cosmwasm 2020-07-23 22:53:42 +02:00
Reuven Podmazo a7f801d123
fixed recursive queries losing context 2020-07-22 16:13:56 +03:00
Alex Peters ad520ed1d3
Return init/migration msg with contract history 2020-07-20 17:22:10 +02:00
Alex Peters a1aa2f5e4c
Fix codec for msg 2020-07-20 14:59:23 +02:00
Alex Peters e62f2cac44
Add CLI + REST support for contract history 2020-07-20 14:58:44 +02:00
Alex Peters 430da1dbf5
Remove unused arguments 2020-07-20 14:44:19 +02:00
Alex Peters 00adcb4a58
Add contract history query handler 2020-07-20 14:44:19 +02:00
Alex Peters 72a1a45030
Use prefix store for contract history 2020-07-20 14:44:19 +02:00
Alex Peters 1c4d4d8f0e
Validate json msg payload 2020-07-20 14:43:23 +02:00
Alex Peters 882d8177b8
Verify genesis import data 2020-07-20 14:42:26 +02:00
Alex Peters e6e4839875
Genesis export via code prefix 2020-07-20 14:42:26 +02:00
Ethan Frey 65e4e3a9b5
Merge pull request #195 from CosmWasm/update_history
Full history of contract code migrations
2020-07-20 14:29:50 +02:00
Ethan Frey 45ef2f331e
Merge pull request #201 from CosmWasm/polish_handler
Polish types in message handler
2020-07-20 10:58:24 +02:00
Alexander Peters 02a54d33ff
Merge pull request #204 from CosmWasm/code_id
Rename ambiguous Code attribute
2020-07-20 10:29:43 +02:00
Alexander Peters 81351d8c52
Merge pull request #200 from CosmWasm/amino_renaming
Follow sdk amino naming convention
2020-07-20 10:21:14 +02:00
Alex Peters d9143bc927
Polish for go vet 2020-07-17 17:09:14 +02:00
Alex Peters db464d891b
Rename ambiguous Code attribute 2020-07-17 17:02:21 +02:00
Alex Peters 437f0237ba
Polish types in message handler 2020-07-17 15:39:26 +02:00
Alex Peters 631aa8461c
Follow sdk amino naming convention 2020-07-17 15:21:57 +02:00
Alex Peters a9f31c7cd8
Additional tests and minor updates 2020-07-17 10:40:32 +02:00
Alex Peters 530710e67f
Validate InstantiateConfig in CodeInfo 2020-07-17 09:49:43 +02:00
Alex Peters 871896c62b
Reset history on import 2020-07-16 17:16:28 +02:00
Alex Peters f8dbfd12f0
Store code history for contract 2020-07-16 16:49:14 +02:00
Alexander Peters 774f6d7876
Introduce Wasmgovd (#189)
* Introduce wasmgovd; disable wasm proposals with wasmd

* Update changelog

* Setup wasmgov with permission Nobody

* Review feedback
2020-07-16 16:47:44 +02:00
Ethan Frey 7f02f57f21 Increase and document the MaxGas limit 2020-07-15 16:21:40 +02:00
Ethan Frey 3dc9bed3e9
Merge pull request #190 from CosmWasm/gov_events_181
Cleanup event attribute keys
2020-07-15 16:15:21 +02:00
Alex Peters 165e347150
Cleanup event attribute keys 2020-07-15 10:17:34 +02:00
Alex Peters aff2214391
Better naming for proposal type selections 2020-07-15 09:17:01 +02:00
Alex Peters 4400c4526f
Move enabled gov types to app construction 2020-07-14 13:41:12 +02:00
Alex Peters 7903528306
Add code doc 2020-07-14 13:33:17 +02:00
Alexander Peters 9ab18fc46f
Add wasm gov proposals to cli (#183)
* Add wasm gov proposals to cli

* Update changelog

* Rework gov proposal rest handlers

* Fix json naming

* Pretty print byte arrays in CLI

* Replace ambiguous cli flag and rest routes

* Minor cli usage doc update
2020-07-14 13:30:41 +02:00
Alex Peters ad24376b58
Prevent contract funding from blocked addr 2020-07-09 13:37:33 +02:00
Alex Peters 522ba535cb
Add configurable control for code instantiation 2020-07-08 16:58:35 +02:00
Alex Peters 85a404691a
Add configurable control to upload code 2020-07-08 15:54:02 +02:00
Alexander Peters 8a547179d2
Gov proposal types and handler (#173)
* Gov proposal types and handler

* Review feedback

* Store code proposal and test

* Accept only valid proposals

* Complete proposal types
2020-07-07 17:55:11 +02:00
Alex Peters 82702a0bea
Genesis code import not position agnostic 2020-07-01 12:03:25 +02:00
Alex Peters 44696c4a98
Test validateBasic methods 2020-07-01 09:59:40 +02:00
Alex Peters f7b4acf47c
Review comments and additinal tests 2020-06-30 20:37:21 +02:00
Alex Peters a20e568bff
Validate genesis model 2020-06-30 11:09:15 +02:00
Alex Peters 005c8bfe0a
Go 1.13 backport 2020-06-29 18:07:03 +02:00
Alex Peters f71a9bbb13
Ex/Import missing LastInstanceID key 2020-06-29 16:49:45 +02:00
Alex Peters 077d99dbc2
Initial fuzz test 2020-06-29 16:07:58 +02:00
Ethan Frey 5fd8dc363c Update to go-cosmwasm 0.9.0-beta 2020-06-26 16:41:31 +02:00
Ethan Frey 3b96d488c1 Updated with PR comments 2020-06-26 12:06:15 +02:00
Ethan Frey fc7ba5ad5f Wire up MsgClearAdmin in handler 2020-06-26 11:30:46 +02:00
Ethan Frey 4dac673884 Add MsgClearAdmin, MsgUpdateAdmin requires admin set 2020-06-26 11:27:34 +02:00
Ethan Frey b65f47f95a Rename MsgUpdateAdministrator -> MsgUpdateAdmin 2020-06-26 11:11:44 +02:00
Ethan Frey e0f9319624 Fix test cases 2020-06-23 15:59:36 +02:00
Ethan Frey 3f55bd7ceb Update to go-cosmwasm 0.9.0-alpha3 with new test contracts 2020-06-23 15:55:37 +02:00
Ethan Frey 420f3e2deb Update gas costs in unit tests 2020-06-22 21:07:02 +02:00
Ethan Frey 751ce5a9bf Charge gas per instance created 2020-06-22 21:05:31 +02:00
Ethan Frey cefd743146 Update test code 2020-06-22 14:00:50 +02:00
Ethan Frey ac95b583fc Update to handle multiple response types 2020-06-22 13:44:06 +02:00
Ethan Frey f7d8d6bd6f Update with go-cosmwasm fix 2020-06-15 23:58:21 +02:00
Ethan Frey ab5fdbb6c9
Merge pull request #141 from CosmWasm/minor_fixes
Minor fixes
2020-06-15 10:01:43 +02:00
Alex Peters 42f544f5c8
Minor fixes 2020-06-12 14:50:59 +02:00
Alex Peters 21df300847
Verify migration events 2020-06-11 11:38:46 +02:00
Alex Peters 3a317f6fad
Add migration integraton tests 2020-06-11 10:37:47 +02:00
Ethan Frey 46b2cadfd0 Update go-cosmwasm and test contracts 2020-06-09 14:27:01 +02:00
Alexander Peters ebac9aac66
Implement CLI/REST server support for new messages (#131)
* Cleanup ContractInfo type

* Add admin to contract instanciation

* Add cli commands for new TX

* Add rest support for new TX

* Update changelog

* Make optional admin flag for better UX

* Add flag to not accidentally clear admin on update
2020-06-05 15:08:11 +02:00
Alexander Peters 9a16d583d3
Update contract admin (#124)
* Add update administrator

* Review comments
2020-06-05 14:02:01 +02:00
Reuven Podmazo 0ba1e68ff0
fixed test 2020-06-04 16:33:57 +03:00
Reuven Podmazo 675c92fedc
added the GasConsumed method to QueryHandler 2020-06-04 16:32:27 +03:00
Alexander Peters 81d8560d41
Migrate contract backend functionality with go-cosmwasm stub impl (#122)
* Start migration server side

* Return migration response and emit events

* Dispatch migrate contract messages

* Rebase to 0.9 and minor updates

* Review feedback

* Update changelog

* Add msg test
2020-06-04 08:54:30 +02:00
Ethan Frey 545681db81 Update tests for new contracts 2020-06-03 17:08:41 +02:00
Ethan Frey a03f4af61b Update wasm contracts 2020-06-03 17:06:08 +02:00
Reuven Podmazo da3964a786
updated commit of go-cosmwasm dependency to branch dynamic-gas-metering 2020-05-28 00:54:22 +03:00
Reuven Podmazo 398763ae9a
adjusted gas consumption logic in case of errors in go-cosmwasm
see:
https://github.com/CosmWasm/go-cosmwasm/pull/90
https://github.com/CosmWasm/cosmwasm/pull/359
2020-05-25 21:01:05 +03:00
Ethan Frey a6bcf8c16e Update for new staking queries 2020-05-19 21:34:46 +02:00
Ethan Frey 5dbc443ae0 Import updated test contracts 2020-05-19 21:34:46 +02:00
Ethan Frey 533f4189fa Cleanup 2020-05-18 21:55:34 +02:00
Ethan Frey eed809c22f Reinvest tests pass! 2020-05-18 21:49:11 +02:00
Ethan Frey ade03a1d39 Progress on distro wiring for reinvest 2020-05-18 21:08:04 +02:00
Ethan Frey 11f889dac8 Test coverage for unbonded case 2020-05-18 18:15:47 +02:00
Ethan Frey d80a6ea383 Add more queries to bonded case 2020-05-18 17:38:36 +02:00
Ethan Frey da57fd357b Test contract bonds properly 2020-05-18 17:28:31 +02:00
Ethan Frey c4c1f9cf35 Test scaffolding for staking, test init and query callbacks 2020-05-18 15:45:10 +02:00
Ethan Frey 0379db676c Add staking contract, rename mask -> reflect 2020-05-18 13:04:24 +02:00
Ethan Frey 95bd9e8efa Update alias.go, format, clean imports 2020-05-13 22:55:07 +02:00
Ethan Frey c829fcff5a Rename import from cosmwasm/wasmd to CosmWasm/wasmd 2020-05-13 22:15:40 +02:00
Ethan Frey 27617a7551 Update test contracts and gas prices 2020-05-13 21:19:51 +02:00
Ethan Frey 945067f5c0 Update to 0.8.0-alpha2 2020-05-13 21:16:18 +02:00
Ethan Frey c691c79042 Calculate staked amount for delegation 2020-05-11 13:22:57 +02:00
Ethan Frey 21fa8a6ba5 Test all CosmosMsg -> sdk.Msg encoding 2020-05-11 12:39:49 +02:00
Ethan Frey 6b88cefe43 Add staking queries with some open TODOs 2020-05-11 11:28:07 +02:00
Ethan Frey e6dd80493b Implement StakingMsg.Withdraw as two sdk messages 2020-05-11 09:58:16 +02:00
Ethan Frey b2ba8026ef WasmMsg Encoders can return []sdk.Msg 2020-05-11 09:53:34 +02:00
Ethan Frey 102ac8ed1d Add staking messages except Withdraw 2020-05-11 09:45:35 +02:00
Ethan Frey 8306d89010 Properly throw OutOfGas when we hit storage limits inside the contract 2020-05-07 12:03:31 +02:00
Ethan Frey b3fe657920 Test custom query callbacks with mask contract 2020-05-07 11:43:57 +02:00
Ethan Frey 001969c70e Add wasm query callback 2020-05-07 11:27:17 +02:00
Ethan Frey 0ca2ff6702 Make QueryPlugins configurable for keeper 2020-05-07 11:08:20 +02:00
Ethan Frey 7caa786d71 Register and demo custom message handlers with mask 2020-05-07 10:40:54 +02:00
Ethan Frey 7b7a293835 Allow configuring custom message handlers in wasm 2020-05-07 10:20:18 +02:00
Ethan Frey f727cb4aff Load contractAccount less, just use AccAddress 2020-05-07 09:59:32 +02:00
Ethan Frey 3f3eb3ef5c Fix up module level tests, only 2 skipped 2020-05-06 20:00:35 +02:00
Ethan Frey 42d187058e Handle Wasm instantiate 2020-05-06 17:26:36 +02:00
Ethan Frey ffcab2176a Allow contracts to dispatch contract messages 2020-05-06 17:21:59 +02:00
Ethan Frey 77d1ea4c22 Add bank querier 2020-05-06 13:58:18 +02:00
Ethan Frey f4294868d6 internal tests pass, with 3-4 skipped for now, escrow contract old 2020-05-06 12:45:23 +02:00
Ethan Frey 91bd23b910 Updated internal/keeper testcontracts to 0.8-dev 2020-05-06 12:09:11 +02:00
Ethan Frey a53bfdf612 Added stubs for handler, querier to compile code 2020-05-06 11:57:55 +02:00
Ethan Frey 03ad1fb1a0 Update to CosmWasm/go-cosmwasm master 2020-05-06 11:21:15 +02:00
Ethan Frey d9afc08be6 Simplify handling of simulation in UploadCode given v0.7.1 behavior 2020-03-12 15:30:03 +01:00
Ethan Frey 9dda90cdf6 Update simulation test to the high-level behavior we want - simulate than create for real 2020-03-12 15:29:07 +01:00
Ethan Frey b389b75fdb Add test failure (cannot create duplicate) 2020-03-12 15:21:16 +01:00
Assaf Morami bb18c59c5d
Implement query list-contract-by-code for the CLI 2020-03-04 12:12:36 +02:00
Ethan Frey ba4ce39a8e Add support for --label when instantiating contracts 2020-03-02 16:29:14 +01:00
Ethan Frey 38080d2465
Merge pull request #97 from cosmwasm/stricter-build-checks
Stricter build checks
2020-03-02 16:21:59 +01:00
Ethan Frey b5601c8ec7 Fixed test case 2020-03-02 16:09:22 +01:00
Ethan Frey ecdacd03e3 Update README on events 2020-03-02 15:57:28 +01:00
Ethan Frey 188d156122 Update logic and fix genesis test 2020-03-02 15:48:13 +01:00
Ethan Frey 10aea17a75 Add failing tests for the new conditions to restrict 2020-03-02 15:44:07 +01:00
Ethan Frey fee390d8f4 Return all info with GetCode, not just wasm 2020-03-01 21:20:34 +01:00
Ethan Frey 4bac7d7daf Return null not error when query missing contract 2020-02-29 20:50:38 +01:00
Ethan Frey 79d45f0525 Remove unneeded filter in handleSdkMessage 2020-02-27 20:13:29 +01:00
Ethan Frey 8dfde7e77f Remove the "message" events from other modules inside x/wasm 2020-02-27 20:11:32 +01:00
Ethan Frey 3b995f9638 Update sdk fork, test better transfer events 2020-02-27 19:25:53 +01:00
Ethan Frey 443c6b9614 Also redact Created field when showing contract details 2020-02-27 19:07:56 +01:00
Ethan Frey 340fa4c5b2 Test and fix the sorting and redacting of created at 2020-02-27 19:07:56 +01:00
Ethan Frey 4a2ee1ab9a Store CreatedAt info when instantiating contracts 2020-02-27 19:07:56 +01:00
Ethan Frey c72cc4596e Add CreatedAt info to ContractInfo 2020-02-27 19:07:56 +01:00
Ethan Frey 863c5e1439 Cleanup rest - no null init_msg, error on no such contract 2020-02-27 18:08:06 +01:00
Ethan Frey 34413d1e83 Return proper json object, not string, for all queries 2020-02-27 17:45:58 +01:00
Ethan Frey eeb12592f3 Use height from query and return height on query 2020-02-27 17:45:58 +01:00
Ethan Frey 2b1972ace3 Proper json for MsgInstantiateContract.Label 2020-02-27 17:44:10 +01:00
Ethan Frey f511afec50 Fix markdown 2020-02-27 16:39:50 +01:00
Ethan Frey 9f15833a34 Add notes to README to trigger PR update 2020-02-27 16:18:51 +01:00
Ethan Frey 5120b5210f Test and document current tag behavior 2020-02-27 16:11:57 +01:00
Ethan Frey 502e02429e Properly emit events for every sub-message dispatched by x/wasm 2020-02-27 15:46:27 +01:00
Ethan Frey 7e0d3202e6 Document events that are dispatched 2020-02-27 15:20:11 +01:00
Ethan Frey 90192b8257 Cleanup mask tests 2020-02-27 14:47:43 +01:00
Ethan Frey 4ee327ff2c Add updated mask contract 2020-02-27 14:37:59 +01:00
Ethan Frey 4ad9c900a4 Update test contract, escrow to 0.7 version 2020-02-27 12:24:13 +01:00
Ethan Frey 9b8dcefb24 x/wasm compiles, many tests fail 2020-02-27 11:47:30 +01:00