-
Notifications
You must be signed in to change notification settings - Fork 446
feat(stdlibs)!: std split #4040
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
Conversation
🛠 PR Checks SummaryAll Automated Checks passed. ✅ Manual Checks (for Reviewers):
Read More🤖 This bot helps streamline PR reviews by verifying automated checks and providing guidance for contributors and reviewers. ✅ Automated Checks (for Contributors):🟢 Maintainers must be able to edit this pull request (more info) ☑️ Contributor Actions:
☑️ Reviewer Actions:
📚 Resources:Debug
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
|
@gfanton @dongwon8247, please also vote on the tech committee google group thread :) |
zivkovicmilos
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
NT Tech Committee approved unanimously. Let's merge! |
This pull request performs the std split as specified initially in gnolang#1475, then gnolang#3874. Fixes gnolang#3874. Use gnolang#4753 for a "files changed" tab that won't crash your browser Most changes in `examples` are automated, and performed using `gno fix` (gnolang#4100). `gno fix` is a tool developed to update old Gno code into new one, so that this change and possible future changes are the least disruptive to those working with Gno code. Most of the changes can be boiled down to the following: | original syntax | new syntax | notes | | ------------------------------ | --------------------------------------- | ---------------------------------- | | ```std.Address``` | ```address``` | on master, it is just a type alias | | ```std.Emit``` | ```chain.Emit``` | | | ```std.DerivePkgAddr``` | ```chain.PackageAddress``` | | | ```std.Coin``` | ```chain.Coin``` | | | ```std.Coins``` | ```chain.Coins``` | | | ```std.NewCoin``` | ```chain.NewCoin``` | | | ```std.NewCoins``` | ```chain.NewCoins``` | | | ```std.CoinDenom``` | ```chain.CoinDenom``` | | | ```std.RawAddressSize``` | ```20``` | constant removed | | ```std.RawAddress``` | ```[20]byte``` | type removed | | ```std.EncodeBech32``` | *removed* | manual conversion required | | ```std.DecodeBech32``` | *removed* | manual conversion required | | ```std.AssertOriginCall``` | ```chain/runtime.AssertOriginCall``` | | | ```std.PreviousRealm``` | ```chain/runtime.PreviousRealm``` | | | ```std.CurrentRealm``` | ```chain/runtime.CurrentRealm``` | | | ```std.NewUserRealm``` | ```testing.NewUserRealm``` | moved to ```testing``` package | | ```std.NewCodeRealm``` | ```testing.NewCodeRealm``` | moved to ```testing``` package | | ```std.OriginCaller``` | ```chain/runtime.OriginCaller``` | | | ```std.ChainDomain``` | ```chain/runtime.ChainDomain``` | | | ```std.ChainHeight``` | ```chain/runtime.ChainHeight``` | | | ```std.ChainID``` | ```chain/runtime.ChainID``` | | | ~~```std.CallerAt```~~ | ~~```chain/runtime.CallerAt```~~ | removed on master | | ```std.Realm``` | ```chain/runtime.Realm``` | | | ```std.Banker``` | ```chain/banker.Banker``` | | | ```std.NewBanker``` | ```chain/banker.NewBanker``` | | | ```std.BankerType``` | ```chain/banker.BankerType``` | | | ```std.OriginSend``` | ```chain/banker.OriginSend``` | | | ```std.BankerTypeReadonly``` | ```chain/banker.BankerTypeReadonly``` | | | ```std.BankerTypeOriginSend``` | ```chain/banker.BankerTypeOriginSend``` | | | ```std.BankerTypeRealmSend``` | ```chain/banker.BankerTypeRealmSend``` | | | ```std.BankerTypeRealmIssue``` | ```chain/banker.BankerTypeRealmIssue``` | | | ```std.SetParamBool``` | ```chain/params.SetBool``` | | | ```std.SetParamBytes``` | ```chain/params.SetBytes``` | | | ```std.SetParamInt64``` | ```chain/params.SetInt64``` | | | ```std.SetParamString``` | ```chain/params.SetString``` | | | ```std.SetParamStrings``` | ```chain/params.SetStrings``` | | | ```std.SetParamUint64``` | ```chain/params.SetUint64``` | | | **Moved from previous iterations** | | | | ```chain.Address``` | ```address``` | | | ```chain.DerivePkgAddr``` | ```chain.PackageAddress``` | | | ```chain.DerivePkgAddress``` | ```chain.PackageAddress``` | | | ```chain/runtime.NewUserRealm``` | ```testing.NewUserRealm``` | moved to ```testing``` package | | ```chain/runtime.NewCodeRealm``` | ```testing.NewCodeRealm``` | moved to ```testing``` package | | ```chain/runtime.CoinDenom``` | ```chain.CoinDenom``` | promoted to ```chain``` package | | ```chain/banker.Coin``` | ```chain.Coin``` | promoted to ```chain``` package | | ```chain/banker.Coins``` | ```chain.Coins``` | promoted to ```chain``` package | | ```chain/banker.NewCoin``` | ```chain.NewCoin``` | promoted to ```chain``` package | | ```chain/banker.NewCoins``` | ```chain.NewCoins``` | promoted to ```chain``` package | There are some additional changes that are not "direct translations": - The `testing` package has been moved entirely into the testing stdlibs. I don't recall the exact reason for it, but I think it simplified something else in the split, and is something we should do anyway as part of gnolang#3775 - stdlibs now don't overlap now with testing stdlibs. Internally, chain/runtime still does, but it exposes no additional functions. - I removed `AddressSet` as an API that can be very easily implemented in userland and which is not commonly used enough to justify its inclusion in `chain`. Further things to do: - [x] Removing Encode/DecodeBech32 - [x] Deciding what to do about DerivePkgAddr / Address: rename DerivePkgAddr to DerivePkgAddress, or Address to Addr? - [x] Fix remaining `gno test ./...` issues. - [x] Move to `std.DerivePkgAddr` to `chain.PackageAddress` - [x] Moving Coin, Coins to `chain` as banker-independent types. - [x] Move NewUserRealm / NewCodeRealm to `testing`. - [x] Deciding where to move `CoinDenom`. - [ ] Approval from Jae / NT tech committee. Let's use this PR to see the result of the split, and see what should be changed. --------- Co-authored-by: MikaelVallenet <[email protected]>
The gno PR gnolang/gno#4040 reorganizes many files causing breaking changes, including the following error from Gnokey Mobile. ``` unable to unmarshal response bytes, amino: unrecognized concrete type full name tm.Event ``` This PR updates to the latest gno version. (The same version as the updated tx-indexer.) Signed-off-by: Jeff Thompson <[email protected]>
This pull request performs the std split as specified initially in gnolang#1475, then gnolang#3874. Fixes gnolang#3874. Use gnolang#4753 for a "files changed" tab that won't crash your browser Most changes in `examples` are automated, and performed using `gno fix` (gnolang#4100). `gno fix` is a tool developed to update old Gno code into new one, so that this change and possible future changes are the least disruptive to those working with Gno code. Most of the changes can be boiled down to the following: | original syntax | new syntax | notes | | ------------------------------ | --------------------------------------- | ---------------------------------- | | ```std.Address``` | ```address``` | on master, it is just a type alias | | ```std.Emit``` | ```chain.Emit``` | | | ```std.DerivePkgAddr``` | ```chain.PackageAddress``` | | | ```std.Coin``` | ```chain.Coin``` | | | ```std.Coins``` | ```chain.Coins``` | | | ```std.NewCoin``` | ```chain.NewCoin``` | | | ```std.NewCoins``` | ```chain.NewCoins``` | | | ```std.CoinDenom``` | ```chain.CoinDenom``` | | | ```std.RawAddressSize``` | ```20``` | constant removed | | ```std.RawAddress``` | ```[20]byte``` | type removed | | ```std.EncodeBech32``` | *removed* | manual conversion required | | ```std.DecodeBech32``` | *removed* | manual conversion required | | ```std.AssertOriginCall``` | ```chain/runtime.AssertOriginCall``` | | | ```std.PreviousRealm``` | ```chain/runtime.PreviousRealm``` | | | ```std.CurrentRealm``` | ```chain/runtime.CurrentRealm``` | | | ```std.NewUserRealm``` | ```testing.NewUserRealm``` | moved to ```testing``` package | | ```std.NewCodeRealm``` | ```testing.NewCodeRealm``` | moved to ```testing``` package | | ```std.OriginCaller``` | ```chain/runtime.OriginCaller``` | | | ```std.ChainDomain``` | ```chain/runtime.ChainDomain``` | | | ```std.ChainHeight``` | ```chain/runtime.ChainHeight``` | | | ```std.ChainID``` | ```chain/runtime.ChainID``` | | | ~~```std.CallerAt```~~ | ~~```chain/runtime.CallerAt```~~ | removed on master | | ```std.Realm``` | ```chain/runtime.Realm``` | | | ```std.Banker``` | ```chain/banker.Banker``` | | | ```std.NewBanker``` | ```chain/banker.NewBanker``` | | | ```std.BankerType``` | ```chain/banker.BankerType``` | | | ```std.OriginSend``` | ```chain/banker.OriginSend``` | | | ```std.BankerTypeReadonly``` | ```chain/banker.BankerTypeReadonly``` | | | ```std.BankerTypeOriginSend``` | ```chain/banker.BankerTypeOriginSend``` | | | ```std.BankerTypeRealmSend``` | ```chain/banker.BankerTypeRealmSend``` | | | ```std.BankerTypeRealmIssue``` | ```chain/banker.BankerTypeRealmIssue``` | | | ```std.SetParamBool``` | ```chain/params.SetBool``` | | | ```std.SetParamBytes``` | ```chain/params.SetBytes``` | | | ```std.SetParamInt64``` | ```chain/params.SetInt64``` | | | ```std.SetParamString``` | ```chain/params.SetString``` | | | ```std.SetParamStrings``` | ```chain/params.SetStrings``` | | | ```std.SetParamUint64``` | ```chain/params.SetUint64``` | | | **Moved from previous iterations** | | | | ```chain.Address``` | ```address``` | | | ```chain.DerivePkgAddr``` | ```chain.PackageAddress``` | | | ```chain.DerivePkgAddress``` | ```chain.PackageAddress``` | | | ```chain/runtime.NewUserRealm``` | ```testing.NewUserRealm``` | moved to ```testing``` package | | ```chain/runtime.NewCodeRealm``` | ```testing.NewCodeRealm``` | moved to ```testing``` package | | ```chain/runtime.CoinDenom``` | ```chain.CoinDenom``` | promoted to ```chain``` package | | ```chain/banker.Coin``` | ```chain.Coin``` | promoted to ```chain``` package | | ```chain/banker.Coins``` | ```chain.Coins``` | promoted to ```chain``` package | | ```chain/banker.NewCoin``` | ```chain.NewCoin``` | promoted to ```chain``` package | | ```chain/banker.NewCoins``` | ```chain.NewCoins``` | promoted to ```chain``` package | There are some additional changes that are not "direct translations": - The `testing` package has been moved entirely into the testing stdlibs. I don't recall the exact reason for it, but I think it simplified something else in the split, and is something we should do anyway as part of gnolang#3775 - stdlibs now don't overlap now with testing stdlibs. Internally, chain/runtime still does, but it exposes no additional functions. - I removed `AddressSet` as an API that can be very easily implemented in userland and which is not commonly used enough to justify its inclusion in `chain`. Further things to do: - [x] Removing Encode/DecodeBech32 - [x] Deciding what to do about DerivePkgAddr / Address: rename DerivePkgAddr to DerivePkgAddress, or Address to Addr? - [x] Fix remaining `gno test ./...` issues. - [x] Move to `std.DerivePkgAddr` to `chain.PackageAddress` - [x] Moving Coin, Coins to `chain` as banker-independent types. - [x] Move NewUserRealm / NewCodeRealm to `testing`. - [x] Deciding where to move `CoinDenom`. - [ ] Approval from Jae / NT tech committee. Let's use this PR to see the result of the split, and see what should be changed. --------- Co-authored-by: MikaelVallenet <[email protected]>


This pull request performs the std split as specified initially in #1475, then #3874. Fixes #3874.
Use #4753 for a "files changed" tab that won't crash your browser
Most changes in
examplesare automated, and performed usinggno fix(#4100).gno fixis a tool developed to update old Gno code into new one, so that this change and possible future changes are the least disruptive to those working with Gno code.Most of the changes can be boiled down to the following:
std.Addressaddressstd.Emitchain.Emitstd.DerivePkgAddrchain.PackageAddressstd.Coinchain.Coinstd.Coinschain.Coinsstd.NewCoinchain.NewCoinstd.NewCoinschain.NewCoinsstd.CoinDenomchain.CoinDenomstd.RawAddressSize20std.RawAddress[20]bytestd.EncodeBech32std.DecodeBech32std.AssertOriginCallchain/runtime.AssertOriginCallstd.PreviousRealmchain/runtime.PreviousRealmstd.CurrentRealmchain/runtime.CurrentRealmstd.NewUserRealmtesting.NewUserRealmtestingpackagestd.NewCodeRealmtesting.NewCodeRealmtestingpackagestd.OriginCallerchain/runtime.OriginCallerstd.ChainDomainchain/runtime.ChainDomainstd.ChainHeightchain/runtime.ChainHeightstd.ChainIDchain/runtime.ChainIDstd.CallerAtchain/runtime.CallerAtstd.Realmchain/runtime.Realmstd.Bankerchain/banker.Bankerstd.NewBankerchain/banker.NewBankerstd.BankerTypechain/banker.BankerTypestd.OriginSendchain/banker.OriginSendstd.BankerTypeReadonlychain/banker.BankerTypeReadonlystd.BankerTypeOriginSendchain/banker.BankerTypeOriginSendstd.BankerTypeRealmSendchain/banker.BankerTypeRealmSendstd.BankerTypeRealmIssuechain/banker.BankerTypeRealmIssuestd.SetParamBoolchain/params.SetBoolstd.SetParamByteschain/params.SetBytesstd.SetParamInt64chain/params.SetInt64std.SetParamStringchain/params.SetStringstd.SetParamStringschain/params.SetStringsstd.SetParamUint64chain/params.SetUint64chain.Addressaddresschain.DerivePkgAddrchain.PackageAddresschain.DerivePkgAddresschain.PackageAddresschain/runtime.NewUserRealmtesting.NewUserRealmtestingpackagechain/runtime.NewCodeRealmtesting.NewCodeRealmtestingpackagechain/runtime.CoinDenomchain.CoinDenomchainpackagechain/banker.Coinchain.Coinchainpackagechain/banker.Coinschain.Coinschainpackagechain/banker.NewCoinchain.NewCoinchainpackagechain/banker.NewCoinschain.NewCoinschainpackageThere are some additional changes that are not "direct translations":
testingpackage has been moved entirely into the testing stdlibs. I don't recall the exact reason for it, but I think it simplified something else in the split, and is something we should do anyway as part of Removing unstable stdlibs + review of diff from latest go version #3775AddressSetas an API that can be very easily implemented in userland and which is not commonly used enough to justify its inclusion inchain.Further things to do:
gno test ./...issues.std.DerivePkgAddrtochain.PackageAddresschainas banker-independent types.testing.CoinDenom.Let's use this PR to see the result of the split, and see what should be changed.