From ce9d0b22cfcb77ac6f9f17053bdf07644fb30972 Mon Sep 17 00:00:00 2001 From: Roman Khimov Date: Thu, 18 Nov 2021 16:37:42 +0300 Subject: [PATCH] *: use NEP-XX naming consistently in docs/comments Standards are NEP-11 and NEP-17, not NEP11, not NEP17, not anything else. Variable/function names of course can use whatever fits, but documents and comments should be consistent wrt this. --- CHANGELOG.md | 20 ++++++++++---------- cli/nep11_test.go | 4 ++-- cli/nep17_test.go | 2 +- cli/testdata/verify.go | 4 ++-- cli/wallet/nep11.go | 26 +++++++++++++------------- cli/wallet/nep17.go | 16 ++++++++-------- cli/wallet/wallet.go | 4 ++-- docs/cli.md | 2 +- examples/README.md | 2 +- examples/nft-nd-nns/nns.go | 2 +- examples/nft-nd/nft.go | 2 +- pkg/core/blockchain.go | 10 +++++----- pkg/core/dao/dao.go | 8 ++++---- pkg/core/helper_test.go | 2 +- pkg/core/native/management.go | 4 ++-- pkg/core/native/management_test.go | 4 ++-- pkg/core/state/native_state.go | 2 +- pkg/core/state/tokens.go | 4 ++-- pkg/rpc/client/nep11.go | 26 +++++++++++++------------- pkg/rpc/client/nep17.go | 16 ++++++++-------- pkg/rpc/server/server.go | 4 ++-- pkg/smartcontract/manifest/manifest.go | 4 ++-- pkg/wallet/token_test.go | 6 +++--- 23 files changed, 87 insertions(+), 87 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ca54b0783..82fca29cf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -294,7 +294,7 @@ Improvements: StateRootInHeader option (#2028) * cached GAS per vote value leads to substantially improved block processing speed (#2032) - * failed native NEP17 transfers now still re-save the old value to the + * failed native NEP-17 transfers now still re-save the old value to the storage making state dumps compatible with C# (#2034) * refactored and renamed some stackitem package functions, added proper error values in all cases (#2045) @@ -412,30 +412,30 @@ Bugs fixed: ## 0.95.0 "Sharpness" (17 May 2021) This version mostly implements N3 RC2 protocol changes (and is fully -RC2-compatible), but also brings NEP11 CLI support and small improvements for +RC2-compatible), but also brings NEP-11 CLI support and small improvements for node operators. Please note that this release is incompatible with 0.94.1 and there won't be long-term support provided for it. New features: - * CLI command for NEP17 transfers now accepts `data` parameter for the + * CLI command for NEP-17 transfers now accepts `data` parameter for the transfer (#1906) * contract deployment CLI comand now also accepts `data` parameter for `_deploy` method (#1907) - * NEP11 and NEP17 transfers from CLI can now have multiple signers (#1914) + * NEP-11 and NEP-17 transfers from CLI can now have multiple signers (#1914) * `System.Runtime.BurnGas` interop was added to burn some GAS as well as `refuel` GAS contract method to add GAS to current execution environment (#1937) * port number announced via P2P can now differ from actual port node is bound to if new option is used (#1942) - * CLI now supports full set of NEP11 commands, including balance and + * CLI now supports full set of NEP-11 commands, including balance and transfers (#1918) * string split, memory search and compare functions added to stdlib (#1943) * MaxValidUntilBlockIncrement can now be configured (#1963) Behavior changes: - * `data` parameter is now passed in a different way to NEP17 RPC client + * `data` parameter is now passed in a different way to NEP-17 RPC client methods (#1906) * default (used if nothing else specified) signer scope is now `CalledByEntry` in CLI and RPC (#1909) @@ -454,7 +454,7 @@ Behavior changes: * node will reread TLS certificates (if any configured) on SIGHUP (#1945) * contract trusts are now expressed with permission descriptors in manifest (#1946) - * NEP11 transfers now also support `data` parameter (#1950) + * NEP-11 transfers now also support `data` parameter (#1950) * N3 RC2 testnet magic differs from N2 RC1 testnet (#1951, #1954) * stdlib encoding/decoding methods now only accept inputs no longer than 1024 bytes (#1943) @@ -485,7 +485,7 @@ Improvements: Bugs fixed: * `getproof` RPC request returned successful results in some cases where it should fail - * `Transfer` events with invalid numbers were not rejected by NEP17 tracking + * `Transfer` events with invalid numbers were not rejected by NEP-17 tracking code (#1902) * boolean function parameters were not accepted by `invokefunction` RPC call implementation (#1920) @@ -744,9 +744,9 @@ New features: Behavior changes: * VM CLI now supports and requires manifests to properly work with NEF files (#1642) - * NEP17-related CLI commands now output GAS balance as floating point numbers + * NEP-17-related CLI commands now output GAS balance as floating point numbers (#1654) - * `--from` parameter can be omitted now for NEP17 CLI transfers, the default + * `--from` parameter can be omitted now for NEP-17 CLI transfers, the default wallet address will be used in this case (#1655) * native contracts now use more specific types for methods arguments (#1657) * some native contract names and IDs have changed (#1622, #1660) diff --git a/cli/nep11_test.go b/cli/nep11_test.go index 576d7184c..a5852f25d 100644 --- a/cli/nep11_test.go +++ b/cli/nep11_test.go @@ -53,7 +53,7 @@ func TestNEP11Import(t *testing.T) { // already exists e.RunWithError(t, append(args, "--token", nnsContractHash.StringLE())...) - // not a NEP11 token + // not a NEP-11 token e.RunWithError(t, append(args, "--token", neoContractHash.StringLE())...) t.Run("Info", func(t *testing.T) { @@ -283,7 +283,7 @@ func TestNEP11_OwnerOf_BalanceOf_Transfer(t *testing.T) { e.Run(t, append(cmdCheckBalance, "--token", h.StringLE())...) checkBalanceResult(t, nftOwnerAddr, "1") // tokenID1 - // transfer: good, to NEP11-Payable contract, with data + // transfer: good, to NEP-11-Payable contract, with data verifyH := deployVerifyContract(t, e) cmdTransfer = []string{ "neo-go", "wallet", "nep11", "transfer", diff --git a/cli/nep17_test.go b/cli/nep17_test.go index bc86b0bca..d71c458cf 100644 --- a/cli/nep17_test.go +++ b/cli/nep17_test.go @@ -321,7 +321,7 @@ func TestNEP17ImportToken(t *testing.T) { "--wallet", walletPath, "--token", address.Uint160ToString(neoContractHash)) // try address instead of sh - // not a NEP17 token + // not a NEP-17 token e.RunWithError(t, "neo-go", "wallet", "nep17", "import", "--rpc-endpoint", "http://"+e.RPC.Addr, "--wallet", walletPath, diff --git a/cli/testdata/verify.go b/cli/testdata/verify.go index 0e6c51352..3f399c9f6 100644 --- a/cli/testdata/verify.go +++ b/cli/testdata/verify.go @@ -12,8 +12,8 @@ func Verify() bool { func OnNEP17Payment(from interop.Hash160, amount int, data interface{}) { } -// OnNEP11Payment notifies about NEP11 payment. You don't call this method directly, -// instead it's called by NEP11 contract when you transfer funds from your address +// OnNEP11Payment notifies about NEP-11 payment. You don't call this method directly, +// instead it's called by NEP-11 contract when you transfer funds from your address // to the address of this NFT contract. func OnNEP11Payment(from interop.Hash160, amount int, token []byte, data interface{}) { runtime.Notify("OnNEP11Payment", from, amount, token, data) diff --git a/cli/wallet/nep11.go b/cli/wallet/nep11.go index e0393484e..b22d30245 100644 --- a/cli/wallet/nep11.go +++ b/cli/wallet/nep11.go @@ -52,14 +52,14 @@ func newNEP11Commands() []cli.Command { }, { Name: "import", - Usage: "import NEP11 token to a wallet", + Usage: "import NEP-11 token to a wallet", UsageText: "import --wallet --rpc-endpoint --timeout