MCPcopy Create free account
hub / github.com/DNAProject/DNA / NewDeployWasmContract

Function NewDeployWasmContract

wasmtest/wasm-test.go:63–75  ·  view source on GitHub ↗
(signer *account.Account, code []byte)

Source from the content-addressed store, hash-verified

61const testcaseMethod = "testcase"
62
63func NewDeployWasmContract(signer *account.Account, code []byte) (*types.Transaction, error) {
64 mutable, err := utils.NewDeployCodeTransaction(0, 100000000, code, payload.WASMVM_TYPE, "name", "version",
65 "author", "email", "desc")
66 if err != nil {
67 return nil, err
68 }
69 err = utils.SignTransaction(signer, mutable)
70 if err != nil {
71 return nil, err
72 }
73 tx, err := mutable.IntoImmutable()
74 return tx, err
75}
76
77func NewDeployNeoContract(signer *account.Account, code []byte) (*types.Transaction, error) {
78 mutable, err := utils.NewDeployCodeTransaction(0, 100000000, code, payload.NEOVM_TYPE, "name", "version",

Callers 1

mainFunction · 0.85

Calls 1

IntoImmutableMethod · 0.80

Tested by

no test coverage detected