Skip to content

Commit

Permalink
set default contract version to v2
Browse files Browse the repository at this point in the history
  • Loading branch information
studyzy committed Feb 27, 2020
1 parent e5e09c1 commit 4a1f4bd
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ issues:
text: "SA1019:"
- linters:
- dupl
text: "prc20|prc721|vote"
text: "prc20|prc721|vote|deposit"
# # Exclude some linters from running on tests files.
# - path: _test\.go
# linters:
Expand Down
4 changes: 2 additions & 2 deletions core/defaultconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ const (
DefaultMinMediatorInterval = 1
DefaultMinMaintSkipSlots = 0

//contract
DefaultContractSystemVersion = "" //contractId1:v1;contractId2:v2;contractId3:v3
//contract//contractId1:v1;contractId2:v2;contractId3:v3
DefaultContractSystemVersion = "PCGTta3M4t3yXu8uRgkKvaWd2d8DR32W9vM:ptn002;PCGTta3M4t3yXu8uRgkKvaWd2d8DREThG43:ptn002;PCGTta3M4t3yXu8uRgkKvaWd2d8DRijspoq:ptn002;PCGTta3M4t3yXu8uRgkKvaWd2d8DRLGbeyd:ptn002"

DefaultContractSignatureNum = 3
DefaultContractElectionNum = 4
Expand Down
2 changes: 1 addition & 1 deletion internal/ptnapi/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ func parseAddressStr(addr string, ks *keystore.KeyStore, password string) (commo
return common.StringToAddress(addrString)
}

func buildRawTransferTx(b Backend, tokenId, fromStr, toStr string, amount, gasFee decimal.Decimal, password string, useMemoryDag bool) (
func buildRawTransferTx(b Backend, tokenId, fromStr, toStr string, amount, gasFee decimal.Decimal, password string) (
*modules.Transaction, []*modules.UtxoWithOutPoint, error) {
//参数检查
tokenAsset, err := modules.StringToAsset(tokenId)
Expand Down
2 changes: 1 addition & 1 deletion internal/ptnapi/contract_api.go
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ func (s *PrivateContractAPI) CcinvokeToken(ctx context.Context, from, to, token
}
s.b.Lock()
defer s.b.Unlock()
tx, usedUtxo, err := buildRawTransferTx(s.b, token, from, to, amountToken, fee, password, true)
tx, usedUtxo, err := buildRawTransferTx(s.b, token, from, to, amountToken, fee, password)
if err != nil {
return nil, err
}
Expand Down
8 changes: 4 additions & 4 deletions internal/ptnapi/walletapi.go
Original file line number Diff line number Diff line change
Expand Up @@ -1100,7 +1100,7 @@ func (s *PrivateWalletAPI) TransferToken(ctx context.Context, asset string, from
defer s.b.Unlock()
//1. build payment tx
start := time.Now()
rawTx, usedUtxo, err := buildRawTransferTx(s.b, asset, from, to, amount, fee, password, true)
rawTx, usedUtxo, err := buildRawTransferTx(s.b, asset, from, to, amount, fee, password)
if err != nil {
return common.Hash{}, err
}
Expand Down Expand Up @@ -1142,7 +1142,7 @@ func (s *PrivateWalletAPI) TransferTokenSync(ctx context.Context, asset string,
log.Infof("Received transfer token request from:%s, to:%s,amount:%s", fromStr, toStr, amount.String())
s.lock.Lock()
log.Infof("Wait for lock time spend:%s", time.Since(start).String())
tx, usedUtxo, err := buildRawTransferTx(s.b, asset, fromStr, toStr, amount, fee, password, false)
tx, usedUtxo, err := buildRawTransferTx(s.b, asset, fromStr, toStr, amount, fee, password)
if err != nil {
s.lock.Unlock()
return nil, err
Expand Down Expand Up @@ -1447,7 +1447,7 @@ func (s *PrivateWalletAPI) CreateProofOfExistenceTx(ctx context.Context, addr st
mainData, extraData, reference string, password string) (common.Hash, error) {
gasToken := dagconfig.DagConfig.GasToken
ptn1 := decimal.New(1, -2)
rawTx, usedUtxo, err := buildRawTransferTx(s.b, gasToken, addr, addr, decimal.New(0, 0), ptn1, password, false)
rawTx, usedUtxo, err := buildRawTransferTx(s.b, gasToken, addr, addr, decimal.New(0, 0), ptn1, password)
if err != nil {
return common.Hash{}, err
}
Expand Down Expand Up @@ -1497,7 +1497,7 @@ func (s *PrivateWalletAPI) CreateTraceability(ctx context.Context, addr, uid, sy
str := "[{\"TokenID\":\"" + uid + "\",\"MetaData\":\"\"}]"
gasToken := dagconfig.DagConfig.GasToken
ptn1 := decimal.New(1, -1)
rawTx, usedUtxo, err := buildRawTransferTx(s.b, gasToken, addr, addr, decimal.New(0, 0), ptn1, "", false)
rawTx, usedUtxo, err := buildRawTransferTx(s.b, gasToken, addr, addr, decimal.New(0, 0), ptn1, "")
if err != nil {
return common.Hash{}, err
}
Expand Down

0 comments on commit 4a1f4bd

Please sign in to comment.