Skip to content

Commit c04dfe9

Browse files
fix: remove reference comments
1 parent 1645a27 commit c04dfe9

File tree

9 files changed

+4
-32
lines changed

9 files changed

+4
-32
lines changed

.ci-config/rippled.cfg

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -91,12 +91,7 @@ r.ripple.com 51235
9191
# 3. Click on each amendment to get their Amendment ID and name to add to this list manually.
9292
# You will likely update the list with all amendments from a new release of rippled all at once.
9393

94-
# To get the list of amendments on a network (e.g. devnet) follow the steps in xrpl.js's CONTRIBUTING.md for "Updating the Docker container".
95-
# https://github.com/XRPLF/xrpl.js/blob/main/CONTRIBUTING.md
96-
# (Running the script `getNewAmendments.js` should help you identify any new amendments that should be added.)
97-
#
98-
# Note: The version of rippled you use this config with must have an implementation for the amendments you attempt to enable or it will crash.
99-
# If you need the version of rippled to be more up to date, you may need to make a comment on this repo: https://github.com/WietseWind/docker-rippled
94+
10095

10196
[features]
10297
# Devnet amendments as of June 28th, 2023

address-codec/compat_test.go

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ func loadFixtures(t *testing.T) *Fixtures {
6666
}
6767

6868
// TestCompat_EncodeDecodeAccountID tests encoding and decoding of AccountIDs
69-
// Reference: xrpl.js/packages/ripple-address-codec/test/xrp-codec.test.ts
7069
func TestCompat_EncodeDecodeAccountID(t *testing.T) {
7170
fixtures := loadFixtures(t)
7271

@@ -89,7 +88,6 @@ func TestCompat_EncodeDecodeAccountID(t *testing.T) {
8988
}
9089

9190
// TestCompat_EncodeDecodeNodePublic tests encoding and decoding of NodePublic keys
92-
// Reference: xrpl.js/packages/ripple-address-codec/test/xrp-codec.test.ts
9391
func TestCompat_EncodeDecodeNodePublic(t *testing.T) {
9492
fixtures := loadFixtures(t)
9593

@@ -112,7 +110,6 @@ func TestCompat_EncodeDecodeNodePublic(t *testing.T) {
112110
}
113111

114112
// TestCompat_EncodeDecodeAccountPublic tests encoding and decoding of AccountPublic keys
115-
// Reference: xrpl.js/packages/ripple-address-codec/test/xrp-codec.test.ts
116113
func TestCompat_EncodeDecodeAccountPublic(t *testing.T) {
117114
fixtures := loadFixtures(t)
118115

@@ -135,7 +132,6 @@ func TestCompat_EncodeDecodeAccountPublic(t *testing.T) {
135132
}
136133

137134
// TestCompat_EncodeSeed tests seed encoding
138-
// Reference: xrpl.js/packages/ripple-address-codec/test/xrp-codec.test.ts
139135
func TestCompat_EncodeSeed(t *testing.T) {
140136
fixtures := loadFixtures(t)
141137

@@ -157,7 +153,6 @@ func TestCompat_EncodeSeed(t *testing.T) {
157153
}
158154

159155
// TestCompat_DecodeSeed tests seed decoding
160-
// Reference: xrpl.js/packages/ripple-address-codec/test/xrp-codec.test.ts
161156
func TestCompat_DecodeSeed(t *testing.T) {
162157
fixtures := loadFixtures(t)
163158

@@ -180,7 +175,6 @@ func TestCompat_DecodeSeed(t *testing.T) {
180175
}
181176

182177
// TestCompat_IsValidClassicAddress tests classic address validation
183-
// Reference: xrpl.js/packages/ripple-address-codec/test/xrp-codec.test.ts
184178
func TestCompat_IsValidClassicAddress(t *testing.T) {
185179
fixtures := loadFixtures(t)
186180

@@ -202,7 +196,6 @@ func TestCompat_IsValidClassicAddress(t *testing.T) {
202196
}
203197

204198
// TestCompat_XAddressMainnet tests X-address encoding/decoding for mainnet
205-
// Reference: xrpl.js/packages/ripple-address-codec/test/index.test.ts
206199
func TestCompat_XAddressMainnet(t *testing.T) {
207200
fixtures := loadFixtures(t)
208201

@@ -243,7 +236,6 @@ func TestCompat_XAddressMainnet(t *testing.T) {
243236
}
244237

245238
// TestCompat_XAddressTestnet tests X-address encoding/decoding for testnet
246-
// Reference: xrpl.js/packages/ripple-address-codec/test/index.test.ts
247239
func TestCompat_XAddressTestnet(t *testing.T) {
248240
fixtures := loadFixtures(t)
249241

@@ -284,7 +276,6 @@ func TestCompat_XAddressTestnet(t *testing.T) {
284276
}
285277

286278
// TestCompat_InvalidXAddresses tests that invalid X-addresses are properly rejected
287-
// Reference: xrpl.js/packages/ripple-address-codec/test/index.test.ts
288279
func TestCompat_InvalidXAddresses(t *testing.T) {
289280
fixtures := loadFixtures(t)
290281

binary-codec/compat_test.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,6 @@ func convertValue(key string, v any, uint32Fields, intFields map[string]bool) an
154154
}
155155

156156
// TestCompat_EncodeTransaction tests encoding transactions
157-
// Reference: xrpl.js/packages/ripple-binary-codec/test/tx-encode-decode.test.ts
158157
func TestCompat_EncodeTransaction(t *testing.T) {
159158
testCases := []struct {
160159
name string
@@ -196,7 +195,6 @@ func TestCompat_EncodeTransaction(t *testing.T) {
196195
}
197196

198197
// TestCompat_DecodeTransaction tests decoding transactions
199-
// Reference: xrpl.js/packages/ripple-binary-codec/test/tx-encode-decode.test.ts
200198
func TestCompat_DecodeTransaction(t *testing.T) {
201199
testCases := []struct {
202200
name string
@@ -248,7 +246,6 @@ func TestCompat_DecodeTransaction(t *testing.T) {
248246
}
249247

250248
// TestCompat_AccountState tests encoding/decoding ledger entries from codec-fixtures.json
251-
// Reference: xrpl.js/packages/ripple-binary-codec/test/ledger.test.ts
252249
func TestCompat_AccountState(t *testing.T) {
253250
data, err := os.ReadFile("testdata/fixtures/codec-fixtures.json")
254251
require.NoError(t, err, "Failed to read codec-fixtures.json")
@@ -293,7 +290,6 @@ func TestCompat_AccountState(t *testing.T) {
293290
}
294291

295292
// TestCompat_RoundTrip tests that encode(decode(binary)) == binary
296-
// Reference: xrpl.js/packages/ripple-binary-codec/test/binary-json.test.ts
297293
func TestCompat_RoundTrip(t *testing.T) {
298294
testCases := []struct {
299295
name string
@@ -325,7 +321,6 @@ func TestCompat_RoundTrip(t *testing.T) {
325321
}
326322

327323
// TestCompat_XCodecFixtures tests X-address handling in binary codec
328-
// Reference: xrpl.js/packages/ripple-binary-codec/test/fixtures/x-codec-fixtures.json
329324
func TestCompat_XCodecFixtures(t *testing.T) {
330325
data, err := os.ReadFile("testdata/fixtures/x-codec-fixtures.json")
331326
if err != nil {

binary-codec/types/account_id.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,12 @@ func (a *AccountID) FromJSON(value any) ([]byte, error) {
5252
// The method reads the bytes using the binary parser,
5353
// then encodes the result to an AccountID format.
5454
// If no length prefix size is given, it returns an ErrNoLengthPrefix error.
55-
// If the length is 0, it returns an empty string (matching JS behavior for empty AccountIDs).
55+
// If the length is 0, it returns an empty string.
5656
func (a *AccountID) ToJSON(p interfaces.BinaryParser, opts ...int) (any, error) {
5757
if opts == nil {
5858
return nil, ErrNoLengthPrefix
5959
}
6060

61-
// Handle empty AccountID (vlen=0) - matches JS Hash160 behavior
6261
if opts[0] == 0 {
6362
return "", nil
6463
}

binary-codec/types/amount.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -374,8 +374,6 @@ func verifyXrpValue(value string) error {
374374
}
375375

376376
// verifyIOUValue validates the format of an issued currency amount value.
377-
// This matches the JS implementation: const e = (decimal.e || 0) - 15
378-
// where decimal.e is BigNumber's exponent for normalized scientific notation.
379377
func verifyIOUValue(value string) error {
380378
bigDecimal, err := bigdecimal.NewBigDecimal(value)
381379
if err != nil {
@@ -390,9 +388,6 @@ func verifyIOUValue(value string) error {
390388
return &OutOfRangeError{Type: "Precision"}
391389
}
392390

393-
// JS uses: const e = (decimal.e || 0) - 15
394-
// BigNumber.e = Scale + Precision - 1 (for normalized representation)
395-
// So: adjusted_exp = Scale + Precision - 1 - 15 = Scale + Precision - 16
396391
adjustedExp := bigDecimal.Scale + bigDecimal.Precision - 16
397392

398393
if adjustedExp < MinIOUExponent {

binary-codec/types/pathset_test.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ func TestPathSet_FromJson(t *testing.T) {
4646
},
4747
},
4848
},
49-
// Correct encoding without padding (matches xrpl.js)
5049
output: []byte{0x31, 0xb5, 0xf7, 0x62, 0x79, 0x8a, 0x53, 0xd5, 0x43, 0xa0, 0x14, 0xca, 0xf8, 0xb2, 0x97, 0xcf, 0xf8, 0xf2, 0xf9, 0x37, 0xe8, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x55, 0x53, 0x44, 0x0, 0x0, 0x0, 0x0, 0x0, 0xb5, 0xf7, 0x62, 0x79, 0x8a, 0x53, 0xd5, 0x43, 0xa0, 0x14, 0xca, 0xf8, 0xb2, 0x97, 0xcf, 0xf8, 0xf2, 0xf9, 0x37, 0xe8, 0x0},
5150
err: nil,
5251
},
@@ -272,7 +271,6 @@ func TestNewPathSet(t *testing.T) {
272271
},
273272
},
274273
},
275-
// Correct encoding without padding between paths (matches xrpl.js)
276274
expected: []byte{0x31, 0x88, 0xa5, 0xa5, 0x7c, 0x82, 0x9f, 0x40, 0xf2, 0x5e, 0xa8, 0x33, 0x85, 0xbb, 0xde, 0x6c, 0x3d, 0x8b, 0x4c, 0xa0, 0x82, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x55, 0x53, 0x44, 0x0, 0x0, 0x0, 0x0, 0x0, 0x52, 0xc7, 0xf0, 0x1a, 0xd1, 0x3b, 0x3c, 0xa9, 0xc1, 0xd1, 0x33, 0xfa, 0x8f, 0x34, 0x82, 0xd2, 0xef, 0x8, 0xfa, 0x7d, 0x31, 0x88, 0xa5, 0xa5, 0x7c, 0x82, 0x9f, 0x40, 0xf2, 0x5e, 0xa8, 0x33, 0x85, 0xbb, 0xde, 0x6c, 0x3d, 0x8b, 0x4c, 0xa0, 0x82, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x55, 0x53, 0x44, 0x0, 0x0, 0x0, 0x0, 0x0, 0x52, 0xc7, 0xf0, 0x1a, 0xd1, 0x3b, 0x3c, 0xa9, 0xc1, 0xd1, 0x33, 0xfa, 0x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, 0xef, 0x8, 0xfa, 0x7d, 0x31, 0x88, 0xa5, 0xa5, 0x7c, 0x82, 0x9f, 0x40, 0xf2, 0x5e, 0xa8, 0x33, 0x85, 0xbb, 0xde, 0x6c, 0x3d, 0x8b, 0x4c, 0xa0, 0x82, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x55, 0x53, 0x44, 0x0, 0x0, 0x0, 0x0, 0x0, 0x52, 0xc7, 0xf0, 0x1a, 0xd1, 0x3b, 0x3c, 0xa9, 0xc1, 0xd1, 0x33, 0xfa, 0x8f, 0x34, 0x82, 0xd2, 0xef, 0x8, 0xfa, 0x7d, 0x0},
277275
},
278276
}

xrpl/transaction/delegate_set.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ func (d *DelegateSet) Validate() (bool, error) {
129129
permissionValueSet[permissionValue] = 0
130130
}
131131

132-
// Check for duplicates by comparing lengths (like JS implementation)
132+
// Check for duplicates by comparing lengths.
133133
if len(d.Permissions) != len(permissionValueSet) {
134134
return false, ErrDelegateSetDuplicatePermissions
135135
}

xrpl/transaction/types/permission.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
package types
33

44
// Permission represents a transaction permission that can be delegated to another account.
5-
// This matches the xrpl.js Permission interface structure.
65
type Permission struct {
76
Permission PermissionValue `json:"Permission"`
87
}

xrpl/websocket/client.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -536,7 +536,7 @@ func (c *Client) getFeeXrp(cushion float32) (string, error) {
536536

537537
// Calculates the fee per transaction type.
538538
//
539-
// Enhanced implementation that replicates xrpl.js calculateFeePerTransactionType logic,
539+
// Enhanced implementation that replicates calculateFeePerTransactionType logic,
540540
// including special cases for EscrowFinish, AccountDelete, AMMCreate, Batch, and multi-signing.
541541
func (c *Client) calculateFeePerTransactionType(tx *transaction.FlatTransaction, nSigners uint64) error {
542542
// Get base network fee

0 commit comments

Comments
 (0)