Skip to content
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

Add some helpers functions for testing purposes. #435

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

smallhive
Copy link
Contributor

No description provided.

contracts/deploys.go Outdated Show resolved Hide resolved
contracts/deploys.go Outdated Show resolved Hide resolved
@smallhive smallhive force-pushed the contracts-tests-helpers branch 2 times, most recently from e016227 to ded2737 Compare September 23, 2024 05:00
Copy link
Contributor

@cthulhu-rider cthulhu-rider left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

helpers should be tested themselves, especially with current implementation

tests/deploys.go Outdated Show resolved Hide resolved
tests/deploys.go Outdated Show resolved Hide resolved
tests/deploys.go Outdated Show resolved Hide resolved
@smallhive
Copy link
Contributor Author

helpers should be tested themselves, especially with current implementation

I added tests

tests/deploys_test.go Outdated Show resolved Hide resolved
tests/deploys_test.go Outdated Show resolved Hide resolved
tests/deploys_test.go Outdated Show resolved Hide resolved
Signed-off-by: Evgenii Baidakov <evgenii@nspcc.io>
Copy link
Member

@carpawell carpawell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In general, isn't most of the code can (should) be reused from rpc/nns package? It seems like it was made for it but mb I don't know some interfaces mismatch.

nnsInv := e.CommitteeInvoker(nnsHash)

nnsInv.Invoke(t, true, "register", params.Name+".neofs", e.CommitteeHash, params.Email, params.Refresh, params.Retry, params.Email, params.TTL)
nnsInv.Invoke(t, nil, "addRecord", params.Name+".neofs", 16, params.ContractHash.StringLE())
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we use

?

}

func nnsContractInvoker(t *testing.T, e *neotest.Executor) *neotest.ContractInvoker {
nnsHash, err := e.Chain.GetContractScriptHash(1)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think @roman-khimov prefers

func InferHash(sg ContractStateGetter) (util.Uint160, error) {
or at least const from this package

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants