Commit Graph

71 Commits

Author SHA1 Message Date
Alex Peters
c88b8194cb Fix typos 2023-01-27 10:12:18 +01:00
Alexander Peters
957b38e0a5 Integrate wasmvm v1.2.0 (#1161)
* Bump wasmvm version

* Bump wasm test contracts

* Encode weighted votes

* Encode instantiate2

* Handle code info query; better wasmvm errors

* Fix readme

* Make linter happy

* add non cgo build

* Review comments

* Bump wasmvm to release version

Co-authored-by: jhernandezb <contact@jhernandez.me>
2023-01-25 10:01:26 +01:00
GNaD13
4c6afb38eb Change genesis preserving contract history (#1076)
* preserve contract created date on genesis import and add query contract created date

* add validate created

* fix sims test app import export

* add preserve contract history

* Make proto-all only

* Remove ResetFromGenesis

* Add validation

Co-authored-by: Alex Peters <alpe@users.noreply.github.com>
2022-11-11 09:45:40 +01:00
Alexander Peters
a9ce273e3c Introduce AcceptListStargateQuerier (#1069)
* Stargate query enable

* Remove initialized whitelists

* Roman's review

* Minor improvement

* Add tests

* Add testings and codec

* Fix lint

* Fix test

* Fix from code review

* Refactor Stargate querier init

* Fix typo

Co-authored-by: mattverse <mattpark1028@gmail.com>
2022-11-02 17:16:32 +01:00
vuong
6d67d5b4f7 Get Contracts by Creator Address (#1021)
* add query to query.proto

* add ContractsByCreatorPrefix in keys.go

* add ContractCreatorThirdIndex to keeper.go

* add querier

* cli

* fix test

* linting

* add key test

* no need to change creator when migrate

* add query test

* minor

* add migrate logic

* add more test

* register migration

* minor

* Update x/wasm/client/cli/query.go

Co-authored-by: Alexander Peters <alpe@users.noreply.github.com>

* nits

* remove IterateAllContract

* Update x/wasm/keeper/genesis_test.go

Co-authored-by: Alexander Peters <alpe@users.noreply.github.com>

* nit

* nit: func name

* change key

* improve TestIteratorContractByCreator

* fix test

* use IterateContractInfo in migrate2to3

* minor

* move key

* improve test case

* add pagReq in ContractsByCreator query

* ordering query

* add migrate test

* Make ContractsByCreator plural; formatting and minor updates

* Comment why AbsoluteTxPositionLen makes sense

* Migrate 1 to 2

* Set module version

Co-authored-by: Alexander Peters <alpe@users.noreply.github.com>
Co-authored-by: khanh-notional <50263489+catShaark@users.noreply.github.com>
2022-10-20 19:04:41 +02:00
vuong
2abf812a90 Permission (#1050)
* move subset check into 'CanCreateCode'

* testing

* fix logic

* minor

* Code feedback

* clean test

* Revert "clean test"

This reverts commit a59be56b5734fd5153d81d38c41ae91599e3faaf.

* Revert test and make all pass

* Cover instantiation config with tests

* Add gov policy for sanity check

* Test with gov policy for sanity check

Co-authored-by: Alex Peters <alpe@users.noreply.github.com>
2022-10-20 18:30:27 +02:00
Alexander Peters
9c5ebbbc4c Implement improvements to new address generation (#1014)
* Revert default instance address generation to classic sequence based method

 Please enter the commit message for your changes. Lines starting

* Start re-adding classic address generator

* Extract address generation to file; minor updates

* Review comments

* Set max salt size

* Support predictable address on instantiation

* Switch attribute order for backwards compatiblity

* Fix salt param check in CLI

* Enable tests

* Add more tests

* Minor fix

* Remove migration

* Better cli description

* Fix init message length prefix

* Add sanity checks to address generation and minor updates

* Reduce max length in tests for CI

* CLI and address generation updates

* Add test vectors

* Minor updates

* Fix cli long doc
2022-09-22 18:22:35 +02:00
Alexander Peters
54fec05c11 Prune vesting accounts balances (#1003)
* Prevent out of gas

* Prune vesting account denoms only

* Fix test state

* Move account exists error  up again

* Review feedback: better naming
2022-09-21 15:13:58 +02:00
Alex Peters
ccb2fdd0b6 Make contract addresses predictable 2022-09-09 12:42:41 +02:00
Alexander Peters
42758d3a13 Rename features to availableCapabilities (#993)
* Rename features to availableCapabilities as in wasmvm

* Review feedback
2022-09-09 09:22:31 +02:00
xingqiang.yuan
e63e63b0f4 fix bug of contract history 2022-09-08 16:49:42 +08:00
Alexander Peters
e714fdf3b4 Charge gas to unzip wasm code (#898)
* Charge gas for unzip wasm code

* Add uncompress test

* Apply review feedback

* Add testcase to uncompress spec
2022-08-31 16:17:03 +02:00
Alexander Peters
9d63bc061c Merge pull request #901 from CosmWasm/access_config
Restrict code access config modifications
2022-08-23 17:03:31 +02:00
Ethan Frey
f14c46988a Merge pull request #900 from CosmWasm/migration_fix
Prevent migration to a restricted code
2022-08-15 16:53:06 +02:00
Ethan Frey
c25550d775 put sorting fix next to event filtering 2022-07-29 08:42:47 +02:00
Ethan Frey
a697c70650 Code cleanup suggested by @peterbourgon 2022-07-29 08:34:23 +02:00
Alex Lynham
393f49e5cb Fix imports 2022-07-29 08:31:56 +02:00
Alex Lynham
e08c8a37c8 Add sorting fix from terra devs 2022-07-29 08:31:56 +02:00
Alex Peters
e5ff7c195a Restrict code access config modifications 2022-07-08 14:28:45 +02:00
Alex Peters
ffd8a3c871 Prevent migration to a restricted code 2022-07-08 13:13:21 +02:00
Simon Warta
2390ea15a0 Create query stack size limit 2022-05-19 10:35:27 +02:00
Ethan Frey
a67dae70b7 Enforce permission less permissive than default 2022-05-10 16:09:35 +02:00
Ethan Frey
bff3aff95b Run new "make format" 2022-05-09 22:34:26 +02:00
jhernandezb
72710effca add UpdateInstantiateConfig gov proposal 2022-05-09 11:35:37 -06:00
Ethan Frey
1253c8e360 Merge branch 'main' into add-state-sync 2022-05-04 10:18:53 +02:00
Alexander Peters
bfb4d31fca Consolidate MaxWasmSize constraints into a single var (#826)
* Convert MaxWasmSize to var

Also removes redundant maxWasmSize param

* Convert MaxWasmSize to int

* Update CHANGELOG

* Complete max wasm size changes

* Update compile flags

Co-authored-by: Cole Brown <bigswim@gmail.com>
2022-04-29 18:54:06 +02:00
Ethan Frey
4cccddbb37 Put GzipIt and Uncompress logic in a common folder 2022-04-27 21:01:28 +02:00
Alexander Peters
68b4908b78 Unpack contract details from genesis (#802)
* Unpack contract details from genesis

* Address linter warnings
2022-04-12 17:46:44 +02:00
Alex Peters
a543aa53a1 Use callback pattern for contract state iterator 2022-03-25 10:56:21 +01:00
Albert Chon
1c9a1e11b6 fix: close iterators 2022-03-22 19:38:34 -04:00
Ethan Frey
20ed020fa7 Update documentation 2022-01-24 21:25:48 +01:00
Ethan Frey
3acc8c960c Expose SetParams as I will need that for migration code outside of this package 2022-01-24 13:46:18 +01:00
Alexander Peters
b8319aa334 Upgrade to cosmos-sdk v0.45.0 (#717)
* Upgrade to cosmos-sdk v0.44.5

* Upgrade to sdk v0.45.0-rc1

* Fix local test deploy scripts

* Bump to v0.45.0 final release

* Fixed replace to 0.45.0 not rc1

* Fix changed import path since rc1

Co-authored-by: Ethan Frey <ethanfrey@users.noreply.github.com>
2022-01-20 12:47:01 +01:00
Alex Peters
445fbb7564 Open read access to sequences 2021-11-05 15:07:12 +01:00
Alexander Peters
c18bc4b00e Add linter name and minor golint related updates (#663) 2021-10-25 15:33:21 +02:00
fkneeland-figure
57517b0c33 Add golangci lint check on pull requests (#645)
* added golangci lint check on pull requests

* changelog update

* updated to use circleci instead of github actions

* testing a golang change

* added workflow

* updated how we find the golangci command in the make file

* using orb for golangci

* Added golangci install make command

* use docker image for golangci

* stop using make in circleci

* reverted golang change to trigger ci

* gofmt

* make fmt

* fixed a few things

* updated version on golintci

* fixed all the lint errors

* check version

* skipped wrongly failing lint

* Revert generated file changes

* fix import grouping, return errors on failures, initialization of arrays revert

* fixed a few lint errors

* addressed more code review comments

* updated with error check

* increased timeout for golangci-lint

* dont format autogenerated files

Co-authored-by: Carlton Hanna <channa@figure.com>
2021-10-25 09:09:47 +02:00
fkneeland-figure
dd390d7f5f Go Formatting update (#648)
* make fmt

* changelog update
2021-10-21 14:54:16 +02:00
Ethan Frey
e5dc6fe583 Treat all contracts as pinned for gas costs in reply 2021-10-07 11:23:58 +02:00
Assaf Morami
ed96573c53 Fix inconsistent return of contractAddress from keeper/init()
This will not affect functionality whatsoever, it just makes for a more consistent code, as discussed in issue #616.
2021-09-22 21:59:47 +03:00
Alex Peters
2fe56bffaf Fix query handler instantiation 2021-09-13 09:48:31 +02:00
Piotr Husiatyński
b2fc913398 Keeper tests (#590)
* More keeper tests

x/wasm/keeper tests are extended to test various input validation.
Keeper input is validated before passing to the keeper method when used
within wasmd application. We cannot ensure such validation when this
keeper is used outside of wasmd application. To keep it safe, fully
validate keeper methods input.

hackatom.wasm is loaded into memory during initialization to avoid
reading file in each test separately. Once migrated to go 1.16, embed
package should be used instead.

Run goimport on certain files.

Some comments fixed or removed.

* ensure that creator address is not nil
2021-08-27 15:37:07 +02:00
Ethan Frey
f51ec67099 Remove (now-unneeded) filtering in DefaultWasmVMContractResponseHandler.Handle 2021-08-12 13:36:22 +02:00
Ethan Frey
35cc9027d8 Add failing testcase showing messages make it into reply block 2021-08-12 13:15:29 +02:00
Alex Peters
7b2cfa48ed Strip message events and reorder 2021-08-11 14:08:56 +02:00
Alex Peters
7bc048e1ed Add tests for events 2021-08-11 13:12:46 +02:00
Alex Peters
e9156be200 Refactor events 2021-08-10 18:19:16 +02:00
Alex Peters
4f22421404 Add contract features to debug logging
(cherry picked from commit ccd075200f704c39ae619d36be781092711bbd41)
2021-08-05 15:45:08 +02:00
Ethan Frey
6bde321974 x/wasm/keeper compiled 2021-07-28 11:24:44 +02:00
Ethan Frey
6f720a4c88 PR Comment: move where truncating address length to 20 2021-07-28 11:18:58 +02:00
Ethan Frey
1330b115d6 Update hash algorithm 2021-07-28 11:18:21 +02:00